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!

Dividing Currency by Number Makes No Cents 2

Status
Not open for further replies.

crogers111

Technical User
Jan 23, 2004
158
US
CR XI

I'm trying to perform simple division, but the values in the decimals are incorrect. It's as if the decimals are being truncated or is rounding down.

All fields are in the Report Footer.

1. Sum(Data.AmountPaid) = $505,909.98 (Currency)
2. DistinctCount of Data.ClaimNumber = 2865.00 (Number)

Data.ClaimNumber is a string


I've created a formula:

@AvgPerClaim
Sum ({Data.AmountPaid})\DistinctCount ({Data.ClaimNumber})

ISSUE:
The result displayed is 176.00
It should be 176.58

I'm at a loss why this is happening and hoping I'm overlooking something simple
 
A few things to try:

1) Delete the object and add it again. There might be some funky formatting set on it and a new object should eliminate that.

2) Change the formula to:

Totext (Sum ({Data.AmountPaid})\DistinctCount ({Data.ClaimNumber}) , 2)

This eliminates any chance at numeric formatting taking over.

Post the result.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
The BACKWARD SLASH [tt]\[/tt] yields a INTEGER DIVIDE.

try...
[tt]
Sum ({Data.AmountPaid})/DistinctCount ({Data.ClaimNumber})
[/tt]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Good eye skip, went right past that.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Indeed I was overlooking something simple.
Changing to a forward slash did the trick.

Thanks Skip & Ken for the assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top