|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 1:10 PM
Points: 2,673,
Visits: 2,418
|
|
| Interesting question. I thought all Microsoft software did banker's rounding. Thanks.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 10:53 AM
Points: 1,662,
Visits: 1,709
|
|
Daniel Bowlin (10/13/2010) Interesting question. I thought all Microsoft software did banker's rounding. Thanks. It is flexible. CLR procedures in SQL Server, any .NET code can use one of the two MidpointRounding enum values as a mode parameter value of the of the Math.Round method:
Math.Round(4.5, 0, MidpointRounding.AwayFromZero); -- 5 Math.Round(4.5, 0, MidpointRounding.ToEven); -- 4
Oleg
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, August 20, 2012 10:20 AM
Points: 197,
Visits: 98
|
|
Thanks for the comments.
In a view SQL Server returned n.n where in query analyzer it returned n.n0 for each.
My main point was to showcase that there is disparity in programs as to how rounding is performed. Logic or specifications taken at face value (Round the average tax to the nearest tenth) can create differences in results. If you have an application performing the rounding and storing it in the db and run a periodic db script to verify you may get answers that result in 'random' discrepancies.
Tim
There are only 10 types of people that understand binary, those that do and those that do not.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 11:21 AM
Points: 2,163,
Visits: 2,148
|
|
Thanks for the question.
As a note I have always hated the round "to even" method that Microsoft sometimes uses.
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Yesterday @ 10:25 AM
Points: 18,754,
Visits: 12,337
|
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Wednesday, July 25, 2012 9:04 PM
Points: 542,
Visits: 187
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, September 17, 2012 7:30 AM
Points: 1,038,
Visits: 679
|
|
| Thanks! it really helped me to understand clearly
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: 2 days ago @ 1:33 AM
Points: 738,
Visits: 1,126
|
|
Nice one. I hope 2.50 and 2.5 or 3.60 and 3.6 are taken as same!
Thanks.
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:45 AM
Points: 616,
Visits: 97
|
|
|
|
|