title: Format the double precision value in Postgresql
body: <p>I want to get the value from <code>postgresql</code> with formating. The formatting is user option like they want comma separator or not and with decimal place is 2,3 or 4 like.</p>
  
  <p>So now i wrote query like this.</p>
  
  <pre><code> Select to_char(rate,'FM999.00') as BasicSaleRate from table1
  </code></pre>
  
  <p>Its return ans <code>220.00</code>. How to write the query with comma separator value like this <code>'#,0.00'</code>. That means the value more than thousands return with comma separator or not.</p>
  
  <p>Am using <code>postgresql 9.3</code></p>
  
  <p>Thank you</p>