Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

rounding Expand / Collapse
Posted Tuesday, November 13, 2012 2:39 AM


Group: General Forum Members
Last Login: Thursday, October 1, 2015 1:42 AM
Points: 137, Visits: 254
Im performing some calculations and I need to round up the 2 decimal places to the next highest place


calculation result

10.434 should become 10.44

I cant seem to do this with the ROUND function, is the anything else that will do this ?
Post #1383990
Posted Tuesday, November 13, 2012 2:48 AM



Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
Your rounding is not following correct rounding rules, typically anything between 0-4 is rounded down and 5-9 rounded up, so to round a value to 10.44 it would have to be between 10.435 and 10.444.

Can you explain why your logic is not to follow standard rounding?

Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1383994
Posted Tuesday, November 13, 2012 3:20 AM


Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 2,934, Visits: 5,478

SELECT CEILING(10.434 * 100)/100

"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1384005
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse