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

Rounding .05

Status
Not open for further replies.

Kibee

Technical User
Sep 30, 2003
16
0
0
AU
Hi there

I am using Crystal XI

I have a problem that thee accounting application i am working with rounds any decimal with a .5 or .05 etc Down whilst Crystal will round it up.

I dont want to get rid of rounding things etc... it is just a problem when a value such as 8.325 is calculated. My Crystal invoice shows 8.33 and my system shows 8.32

is there a way i can have Crystal round .5s down rather than up or should i report this as a bug in the accounting system. in my experience anything with a .5 is always rounded up.

Thanks

K
 
Is it rounding at all? I think it's dropping the last digit from the number.

Yes?

If so...this would work..(where you replace "8.325" with your DB field)

//FORMULA
local numbervar decpnt := instr("8.325",".");
local numbervar stop := decpnt +2;
left("8.325", stop)

first steps looks for "."
second step adds 2 places past the "."
last step takes number value and takes the values from the left to 2 places past the decimal

Does that make sense? Will that work for you?


-- Jason
"It's Just Ones and Zeros
 
ROUND({YourField},2) will work nicely.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Hi there

hanks for your replie.

The accounting system is definately rounding. the problem is it calculates a discunt on the fly but does not store the value. It just stores a total of the whole invoice. So to show the discount value on the invoice i need to replicate the calculation.

Problem is... when the value is 8.325 for example the system rounds it to 8.32 and crystal will round it to 8.33.

Is there a way i can tell Crystal if i am rounding anything from .1 to .5 to round DOwn and .6 and above to round Up when crystals natural rule seems to be to round .5 Up

thanks

k
 
Truncate({YourField}*100)/100 + (if (YourField}-round({YourField},2)>=.006 then .01 else 0)

Try thisand let me know.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top