Decimal data type value with positive LengthSELECT ROUND(@value, 1); SELECT ROUND(@value, 2); SELECT ROUND(@value, 3); In this example, we can see that with decimal values round up to the nearest value as per the length.
In Oracle, MySQL, and PostgreSQL, you can use either the CEIL() or CEILING() function to round up.
You could cast your result as numeric(x,2)
. Where x <= 38
.
select
round(630/60.0,2),
cast(round(630/60.0,2) as numeric(36,2))
Returns
10.500000 10.50
With SQL Server 2012, you can use the built-in format function:
SELECT FORMAT(Minutes/60.0, 'N2')
You can use:
select cast((630/60.0) as decimal(16,2))
in SQL Server
Declare @number float = 35.44987665;
Select round(@number,2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With