Solved

# Converting an integer to a string with thousand separators

Posted on 2008-06-20

Let's say I have the integer (or better yet, long) 1000000. How can I convert it properly to a string with thousand separators?

On systems where comma is the thousand separator the outcome should be "1,000,000" and on systems where dot is the thousand separator the outcome should be "1.000.000".

I have tried doing String.Format("{0:n}", 1000000); but this just keeps giving me "1.000.000,00" which is not what I want (I don't want the decimal point there at the end, because I am dealing with integers and not doubles).