Take the 2-minute tour ×

Possible Duplicate:
String.Format an integer to use 1000's separator without decimal places or leading 0 for small integers

The blog post


(in the Custom number formatting section) shows that using the format {0:0,0}, a number like 1500 will be formatted as 1,500 which is good. But I don't understand why 0 is formatted as 00

Do I need to handle the case of 0 separately which doesn't seem to be necessary.

share|improve this question

marked as duplicate by Dan J, Mat, George Stocker, djechelon, RRUZ Apr 19 '11 at 18:57


add comment

1 Answer

You can use "F0", which is "fixed number with 0 decimal places". It give you a thousands separator when you results go over 1,000.

share|improve this answer
add comment
