Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Rounding up Post Reply Post New Topic
Author Message
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Topic: Rounding up
     Posted: 18 Apr 2011 at 6:52am
I need to round up on the following forumla.
 
({Command_1.NET_PRIN_AMT} + {Command_1.INC_AMT})
 
Both "net_prin_amt" and "inc_amt" and rounding is set to 0.01 within the format editor under customize on both fields.
 
This formula is bring back 2,859.26 on the amount of 2,859.2684.  So, I should be getting 2,859.27.  Is there something I need to change or add on my forumla to get it to round up? 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Apr 2011 at 7:51am
what about the display, is it set to display only .01?
 
just wondering, as I am not sure what CR will do if it is rounding to .01 but displaying .001.
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 18 Apr 2011 at 8:06am

I'm not sure what you mean when you say the display.  Where do I go?  Please point me in the right direction.  Thanks.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Apr 2011 at 8:09am
on format editor, I was thinking of the customize, since you mentioned rounding to .01.  Right above that is Decimal, is it 1.00?
 
just wondering
 


Edited by lockwelle - 18 Apr 2011 at 8:10am
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 18 Apr 2011 at 8:22am
yes, the decimal is set to 1.00.  I've played around with this as well and there's no change.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Apr 2011 at 9:00am
just reread the original post.
 
what is the formula set to display?  it will take the values from various fields and add them together, but it won't bother looking at how to display them, that is for a different object.  you should change the display on the field that displays the formula.
 
If you already have, then I sorry, I haven't seen this happen...rounding has always worked as expected.
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 20 Apr 2011 at 3:53am
If I have understood you, you are rounding the individual amounts before adding, and then rounding again for the total.
 
So if amount1 is 2000.1342 and amount2 is 859.1342 the total will be
2859.2684 which will round to 2859.27
 
But if you round first, then 2000.1342 => 2000.13
 and 859.1342 => 859.13 which sums to 2859.26
 
 
IP IP Logged
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