I can't seem to find this anywhere, but what is the correct way to always round a number down, to a specific decimal precision, using SQL Server 2005?
Will I need to write my own function or is there already a function that does this?
I do know that SQL Server 2008 R2 has a ROUNDDOWN
function, and it does exactly what I need. Does a similar function exist in 2005?
Rounding down to a specific decimal place is the same as truncating to a decimal place... and you can use round()
to do this:
select round(123.456789, 4, 1)
Returns:
123.456700
Try FLOOR. Google "sql server 2005 floor"
http://msdn.microsoft.com/en-us/library/ms178531(v=sql.90).aspx
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