Expand my Community achievements bar.

Getting numbers to round up using FormCalc

Avatar

Former Community Member
I'm trying to do a mileage form in LiveCycle. The mileage rate is .505 and the math rounds up fine when an odd number of miles is used (13, 15, 17 etc) ..so, miles x .505 = xx.xx until the user adds a bridge toll then the sum rounds down.



Check out my form and tell me what the heck I'm doing wrong please..

thanks!



http://www.kidango.org/kidango.pdf
5 Replies

Avatar

Level 2

What did you do to round up the number? thnx

Avatar

Level 10

The FormCalc function to round numbers is Round().

To round a fields own value to two decimal places use:

$ = Round($, 2)

Avatar

Level 2

thanks so much, i am using num{zzzzzzz9.zz} at the moment and will try this function you listed as well and see if anything changes

Avatar

Level 10

Well, the pattern will only change the displayed value but not the rawValue stored in the data DOM.

So you'll get the unrounded value when you use it somewhere else.