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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Problems

Status
Not open for further replies.

mtorpy

MIS
Aug 20, 2002
31
US
Crystal Report 8.5
I am having problem with a rounding figures. Depending on the hours worked the Rate is showing up sometimes off by one cent.

Sometimes you get $48.68 (48.676) and sometimes $48.67 (48.671) depending on the rounding.

I think the answer would be to bring the decimal out to the thousands place.... 48.672 then do some kind of trim.

Original
{JC20001.PAYRTAMT} + ({JC20001.Overhead_1_Cst_Per_Unit}/{@OT Hours})


I tried
mid ({JC20001.PAYRTAMT} + ({JC20001.Overhead_1_Cst_Per_Unit}/{@OT Hours})1,4)

But that does not work for Integer.

Any ideas

Matt
 
Doesn't round({field},2) work for you? Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
dgillz,
I did try the round function but once again it rounds up on for example 48.676 when using the round({field},2) you still get 48.68 instead of 48.67.

Matt
 
so you want toi truncate at 2 decimals? Even if the value is 48.67999999999 you want 48.67? If so try this formula:

Truncate({Field},2) Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top