Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding & Non Rounding calculation.

Status
Not open for further replies.

idehen

Technical User
Oct 26, 2004
92
GB
Hello Everyone,

Am using CR XI:

I have 2 similar fields which has a difference based on rounding issues. such

Ref Amount Amount2
A123 23.2555 23.26
B255 15.1233 15.12
C564 20.8955 20.90

Amount is what i have created by rounding to 4dp, and Amount 2 is the actual figure received.

What i'll like to do is get a difference of the 2 amounts for example

Ref Amount Amount2 Final Amount
A123 23.2555 23.26 0.0045
B255 15.1233 15.12 -0.0033
C564 20.8955 20.90 0.0045

(Amount 2 - Amount)

Problem is cos the Amount is a rounding of Amount2, the difference i get using CR calculation always comes out as zero.

Is there any way i can use the figues for calculation just as they are without CR doing it's own rounding behind the sceen to return zero.

Thanks


 
If you right-click and choose 'Format Field', you should be able to adjust both the rounding and the display.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Thanks Madawc, not very clear what you mean. Can you break this down just a little further.

am not wanting to format any of the 2 fields. but want to use Amount and Amount2 as their own data instead.
 
It sounds like you simply formatted Amount2 to display a rounded value, instead of actually rounding the data. Instead, use:

round(Amount2,2)

Then you will get a difference in the two values.

-LB
 
Thanks lbass.

That's what i need.

Thanks too Madawc..Appreciate the help everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top