码迷,mamicode.com
首页 > 其他好文 > 详细

ToString(“N2”)和ToString(“0.00”)之间的区别

时间:2017-09-23 13:41:59      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:produce   produces   git   rod   tin   ring   nbsp   str   instead   

看来N会包含数千个分隔符,而0.00则不会。

N2将以500.00的方式工作,但是当您有5000.00时,N2将显示为

5,000.00

代替

5000.00

 

If you do this instead: 0.ToString("0.##"); you get: 0

Interestingly, if you do this: 0.ToString("#.0#"); you get: .0

If you want all three digits: 0.ToString("0.00"); produces: 0.00

ToString(“N2”)和ToString(“0.00”)之间的区别

标签:produce   produces   git   rod   tin   ring   nbsp   str   instead   

原文地址:http://www.cnblogs.com/shy1766IT/p/7580775.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!