Format a number with commas and decimals in C#

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

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

Leave a Comment