Home > Software design >  SQL SERVER ROUND TO ONE DECIMAL VALUES LIKE 0.84
SQL SERVER ROUND TO ONE DECIMAL VALUES LIKE 0.84

Time:03-08

How to round up decimal value to 1 when this is decimal like 0.5 or 0.84?.

CodePudding user response:

You could use CEILING , but a better approach if you have numbers like 367.375000 is to combine CEILING with ROUND like:

select ceiling(round(your_column, 0)) as rounded_nr  ;
Result:
rounded_nr
    367

While

select ceiling(367.375000)  as rounded_nr ; will return:

rounded_nr
368 and 

select round(367.375000, 0) as rounded_nr ;

will return

rounded_nr
367.000000

Check the demo

CodePudding user response:

Just try round(value, decimals)

  • Related