Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Topic: "Banker's" rounding Posted: 09 Jan 2014 at 5:28am
I use Crystal to create reports that work with data from MySql. MySql uses banker's rounding(rounding down from .5) but Crystal does not. Is there a way to force Crystal to use banker's rounding? In other words, I want 1010.265 to round to 1010.26 instead of 1010.27.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 09 Jan 2014 at 5:53am
an idea..
in theory could you subtract .001 from the value and then use the regular rounding function. I think this would only change the final rounding result for records that have the .xx5.
otherwise you could use an if then to subtract the .001 only when the 3rd decimal=5...
Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Posted: 09 Jan 2014 at 6:08am
Great idea! I have added the subtraction to the formula and am using the regular rounding. So far I am getting the desired result every time, I will continue to test and see if I come across any issues.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum