ToString("N2")
和ToString("0.00")
有什么区别?
最佳答案
来自 Standard Numeric Format Strings
The number is converted to a string of the form "-d,ddd,ddd.ddd…", where '-' indicates a negative number symbol if required, 'd' indicates a digit (0-9), ',' indicates a thousand separator between number groups, and '.' indicates a decimal point symbol.
似乎 N
将包含千位分隔符,而 0.00
不会。
另见 Custom Numeric Format Strings
https://stackoverflow.com/questions/4506323/