Getting numbers to round up using FormCalc

Avatar

06-06-2008

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

Replies

Avatar

Avatar

41globalit

Avatar

41globalit

41globalit

06-09-2013

What did you do to round up the number? thnx

Avatar

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

09-09-2013

The FormCalc function to round numbers is Round().

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

$ = Round($, 2)

Avatar

Avatar

41globalit

Avatar

41globalit

41globalit

10-09-2013

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

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

10-09-2013

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.