用逗号和小数点显示号 [英] display number with commas and decimal points
问题描述
我要显示用逗号和小数点多家
I want to display a number with commas and decimal point
1种情况:例如,如果该号码是3494309432324
CASE1 : example if the number is 3494309432324
显示为34,94,30,94,32,324但不34,94,30,94,32,324.00
display as 34,94,30,94,32,324 but not 34,94,30,94,32,324.00
案例2:如果数值十进制值他们,直到2小数点和用逗号
Case 2 : if the number has decimal values them till 2 decimal points and with commas
显示为12,22,222.32
display as 12,22,222.32
目前我做了2位小数,但我不明白的逗号
currently i do this for 2 decimal places but i dont get the commas
Label9.Text = sisRatio.ToString(#0.00);
任何建议..
感谢
推荐答案
假设你想平时的3个数字,然后一个逗号,我认为这会做你需要什么:
Assuming you want the usual 3 numbers then a comma, I think this will do what you need:
Label9.Text = sisRatio.ToString("#,##0.##");
与此一轻微的问题是,它只会小数点后一位,如果第二个是0
One slight issue with this is that it will only one decimal place if the second one would be 0
这篇关于用逗号和小数点显示号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!