Print integer with thousands and millions separator
Got a question about printing Integers with thousands/millions separator. I got a Textfile where i got Country, City,Total Population. I have to read in the File, and sort by country. If country is eual, i have to sort descending by population. Textfile is like: Australia........Sydney.........10.123.456 Brazil...........Sao Paulo.......7.123.345 I read all 3 into a seperated string. Then i erase all "." in the population string. Then i use atoi() to cast the population string to an integer. Now i can sort by population if country is equal. This sort works correctly. So far so good. But i need