Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Getting numbers to round up using FormCalc

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 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.