Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: ToWords rounding issue Post Reply Post New Topic
Author Message
dfolzenlogen
Newbie
Newbie
Avatar

Joined: 23 Feb 2008
Location: United States
Online Status: Offline
Posts: 36
Quote dfolzenlogen Replybullet Topic: ToWords rounding issue
     Posted: 29 Apr 2010 at 3:50pm
Hello.  I am having a rounding issue using ToWords.  I am using the following formulas:
 
@BonusPaid:
If {FifthMailing.BONUS BASIS}= "Per Acre" then {FifthMailing.BONUS}*{FifthMailing.NET ACRES} else {FifthMailing.BONUS}
 
@BonusPaidToDollars:
UpperCase (ToWords({@BonusPaid})+" DOLLARS"+ ReplicateString(" ", 50))
 
Normally, no issues with the above formulas.  TODAY, I had a result of the @BonusPaid = $1568.07
 
HOWEVER, the @BonusPaidToDollars resulted in:
One Thousand Five Hundred Sixty-eight and 06/100 Dollars
 
Note the difference of 1 cent in the @BonusPaidToDollars amount.
 
The NetAcres field is six decimal places with a leading zero.
 
How do I fix this?
 
Thanks.
IP IP Logged
dfolzenlogen
Newbie
Newbie
Avatar

Joined: 23 Feb 2008
Location: United States
Online Status: Offline
Posts: 36
Quote dfolzenlogen Replybullet Posted: 29 Apr 2010 at 4:07pm

Hi folks.  I figured it out.  I changed the BonusPaid formula to read as follows:

If {FifthMailing.BONUS BASIS}= "Per Acre" then Round({FifthMailing.BONUS}*{FifthMailing.NET ACRES},2) else {FifthMailing.BONUS}

 

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