Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server, always rounding up

I need to always round up in SQL Server TSQL, such that I have the Given and need to return the Needed Result:

Given         Needed Result
-----------   --------------
25            25
25.1          26
25.001        26
12            12
0.1            1
0.001          1
0              0
like image 675
xyz Avatar asked Apr 07 '26 07:04

xyz


1 Answers

CEILING(Given) should do the trick.

Ceiling just rounds the given number up to the next whole integer.

like image 136
Wheatevo Avatar answered Apr 08 '26 21:04

Wheatevo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!