title: Rounding off a float/double conditionally
body: <p>I have a unique problem. I have a database with lot of tables and I am trying to do some comparison of each table with a file. now in certain cases my db contains double/float columns and they might exceed a certain no of decimal places than that of the same column in the file. Say for convenience sake we pick this no to be 4 decimal places.</p>
  
  <p>Now I want to convert all float/double columns returned by my db to a string of 4 decimal places if its more than that.how can i achieve the same. Please note that each of ther table might contain in excesss of 2000 rows and I dont want to make this comparison heavy. Any idea how I can achieve the same?</p>
  
  <p>Thanks in advance</p>
  
  <p>Based on some answers and comments:</p>
  
  <p>a) RDBMS: MS SQl server</p>
  
  <p>b)I want the decimal places to only be cut short if it exceeds a certain no.  i.e if the no is 12.123 it should stat 12.123 and nt 12.1230</p>
  
  <p>I realise I can get this done by using # but # just prints the no it doesnt round off the no i.e if the no is 12.12347 it should round off 12.1235</p>