format a number with commas and decimals in C# (asp.net MVC3)

前端 未结 11 1135
予麋鹿
予麋鹿 2020-11-29 03:40

I Need to display a number with commas and decimal point.

Eg: Case 1 : Decimal number is 432324 (This does not have commas or decimal Points) Need to display it

11条回答
  •  温柔的废话
    2020-11-29 04:27

    int number = 1234567890;
    Convert.ToDecimal(number).ToString("#,##0.00");
    

    You will get the result 1,234,567,890.00.

提交回复
热议问题