【发布时间】:2013-11-11 08:31:08
【问题描述】:
我无法在自定义格式化字符串中格式化小数
0.656 => 0.67;
23.656 => 23.67;
5105.54 => 5 105.54;
1234567,89 => 1 234 567,89
我找到了几个帖子:
c# - Using String Format to show decimal upto 2 places or simple integer
c# - Converting Decimal to string with non-default format
但是当尝试使用它们时会遇到一些问题
例如: 关于价值
0.656 我得到“.656”或“.66”
23.656 => “23.656”或“23.66”
有人推荐我可以找到格式字符串规则的链接吗?
【问题讨论】:
标签: c# decimal format-string