Mega Code Archive

 
Categories / MSSQL Tutorial / Math Functions
 

Rounds a value to the number of decimal places specified in the second parameter

ROUND(number_to_round, number_ of_places,[0|1]) A numeric of anything but 0 will mean the number is truncated. 9> 10> SELECT ROUND(100.345678,5,0) 11> GO -----------  100.345680 (1 rows affected) 1> SELECT ROUND(100.345678,5,1) 2> GO -----------  100.345670 (1 rows affected) 1> SELECT ROUND(107.345678,-1,0) 2> GO -----------  110.000000 (1 rows affected)