Page 1 of 1

Calculation accuracy

Posted: Fri May 18, 2001 12:08 pm
by Rick_Anderson_(Guest)
The calculation of ((1-.08)/.08)*100 should equal 1150 and does when entered in a test calculated field. However, when calculated fields that have these values are used in this equation, e.g., ((var1-var2)/var2)*100 the result is 1100.____It may be a problem of rounding in the caluclated values in var1 and var2, but is there a way to force an accurate calculation to 2 decimals so it would not lose the 50 points? ____I tried round() with 2 decimals and still get 1100.00____Am using 8.0.____Thanks

=> RE: Calculation accuracy

Posted: Fri May 18, 2001 3:15 pm
by kfleming
Try__round((round(var1,2)-round(var2,2))/round(var2,2)*100 ,2)____Kathleen__R&R Support

==> RE: Calculation accuracy

Posted: Fri May 18, 2001 10:47 pm
by Rick_Anderson_(Guest)
Thanks, Kathleen____I played around with the equations some more and figured out you must round every part of the equation and the answer comes out correct - just as you indicated in your post. Makes sense.____Rick