Skip to main content
Participant
December 1, 2023
Question

How to limit decimal spaces for simple calulations in a fillable pdf form

  • December 1, 2023
  • 1 reply
  • 646 views

Looking for help with limiting the number of decimal spaces for simple calculations in a fillable pdf form.  We have the pdf created and used "Prepare a Form" for the fillable fields and those fields that are used in the calculation.  The math all works, but when the calculation runs, the resulting answering is infinite decimal fields.  This causes the answer to be an incredibly small font or for the result to read as "Infinite"

 

When I am in the Properties box for the answer field, the Format tab is already set to Number as the format category and Decimal Places is set to 2.

 

Any help would be much appreciated!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 1, 2023

The format setting just limits how the value is displayed, not the actual value itself.

If you're using a calculation script add this to the end of it to truncate the actual value to 2 decimals:

event.value = event.value.toFixed(2);