Calculation accuracy

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Rick_Anderson_(Guest)
Posts: 6
Joined: Tue Oct 10, 2017 12:44 pm

Calculation accuracy

Post by Rick_Anderson_(Guest) » Fri May 18, 2001 12:08 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Calculation accuracy

Post by kfleming » Fri May 18, 2001 3:15 pm

Try__round((round(var1,2)-round(var2,2))/round(var2,2)*100 ,2)____Kathleen__R&R Support

Rick_Anderson_(Guest)
Posts: 6
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Calculation accuracy

Post by Rick_Anderson_(Guest) » Fri May 18, 2001 10:47 pm

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

Post Reply