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.
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?
Thanks in advance
Based on some answers and comments:
a) RDBMS: MS SQl server
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
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
Something like this for float limitation to a number of decimal places:
Apply this to the data that is received from the DB.