title: Print integer with thousands and millions separator
body: <p>Got a question about printing Integers with thousands/millions separator.</p>
  
  <p>I got a Textfile where i got Country, City,Total Population.</p>
  
  <p>I have to read in the File, and sort by country. If country is eual, i have to sort descending by population.</p>
  
  <p>Textfile is like:</p>
  
  <p>Australia........Sydney.........10.123.456</p>
  
  <p>Brazil...........Sao Paulo.......7.123.345</p>
  
  <p>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.</p>
  
  <p>Now i can sort by population if country is equal. This sort works correctly.</p>
  
  <p>So far so good. But i need to get thousand/millions seperator into the printing of the population.</p>
  
  <p>If i use string,with the "." for population, sorting dont work correctly.
  Its sorted like:</p>
  
  <p>x........x......1.123456</p>
  
  <p>x........x......10.123.456</p>
  
  <p>x........x......2.123.232</p>
  
  <p>It have to look like:</p>
  
  <p>Australia........Sydney.........10.123.456</p>
  
  <p>Australia........Brisbane.......8.123.456</p>
  
  <p>Is there a way to manipulate the printing by adding separator the the int again?</p>
  
  <p>Many Thanks in advance</p>