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!

Fixing Decimals

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I am using Crystal 9.0 accessing data from an Access 2002 database.

I have a report that I'm creating a narrative from the calculated values. In one instance I'm calculating the % difference from the first month 90th percentile ER length of stay to the last month 90th percentile ER length of stay. But the problem is that the calculation isn't calculating correctly due to decimal points that I'm not displaying but are there because of the original formula.


So the formula is:
if groupnumber = 1 then (
min_er90A := PthPercentile (90, {@Low_Acu_LOS}, {@ElementA});
);

if groupnumber = distinctcount({@ElementA}) then (
max_er90A := PthPercentile (90, {@Low_Acu_LOS}, {@ElementA});
);

The variance % is:
var_timeA:=(min_ER90A-max_ER90A)/min_ER90A*100;

As an example above, for the period of April 2008 the ER LOS is 2.6 hours and it is 3.2 hours for the last period which is September 2009. The line should read that there is a difference of 23.1% but currently it shows as 20.8% because of the decimal points of the calculations.

Any and all suggestions greatly appreciated - thanks.

 
I can't see here how you are formatting the decimals for display. What are the underlying values for each variable? Why would you WANT to base your results on the displayed value versus the real underlying value? It seems to me it is your display that should change.

Anyway if you want the results to match the displayed value, then you should be rounding or truncating before the calculation.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top