![](/img/trans.png)
[英]format number with 3 trailing decimal places, a decimal thousands separator, and commas after that
[英]Format double - thousands separator with decimal but no trailing zeros
我正在寻找一种格式与string.Format一起使用,将打印以下内容
double d = 123456.123456D;
double d2 = 123456D;
喜欢
123,456.123456
123,456
{0:N6}导致
123,456.123456
123,456.000000
{0:0。######}导致
123456.123456
123456
{0:#。0}导致
123,456
123,456
我无法锻炼能够满足我需要的格式。 我需要定义自己的格式提供程序吗?
你很亲密 使用以下格式:
{0:#,0.######}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.