我想在数字的千位中添加一个逗号.
I want to add a comma in the thousands place for a number.
String.Format()
会是正确的路径吗?我会使用什么格式?
Would String.Format()
be the correct path to take? What format would I use?
String.Format("{0:n}", 1234); // Output: 1,234.00
String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876
这篇关于.NET String.Format() 为数字添加千位逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!