Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: "Banker's" rounding Post Reply Post New Topic
Author Message
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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...
IP IP Logged
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.029 seconds.