我想显示一个带逗号和小数点的数字
CASE1 : example if the number is 3494309432324
display as 34,94,30,94,32,324 but not 34,94,30,94,32,324.00
情况 2:如果数字有十进制值,则小数点后 2 位小数并带有逗号
display as 12,22,222.32
目前我这样做是为了小数点后两位,但我没有得到逗号
Label9.Text = sisRatio.ToString("#0.00");
任何建议..
谢谢
最佳答案
假设您想要通常的 3 个数字然后是一个逗号,我认为这会满足您的需要:
Label9.Text = sisRatio.ToString("#,##0.##");
一个小问题是,如果第二位是 0,它只会保留一位小数
关于c# - 用逗号和小数点显示数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1784564/