Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Large numbers add multiple decimal places

New Here ,
May 09, 2023 May 09, 2023

This is kicking my tail!  We have a form which calculates payments made, due and total.  I have all fields set to two decimal places.  Adding a large number such as 696065.99 to the Contract Price fills in the proper number in the Balance Due column.  However, adding a number larger than 434000 changes the Balance Due to about 11 decimal places (any smaller number does not).  I'm attaching what I see in the colums as the actual numbers and the errors it brings.

I do not get errors with large numbers and decimals in any of the other fillable colums.  I've tried eliminating the text box and re-doing it, but get the same issue.  Please help!

TOPICS
General troubleshooting , JavaScript , PDF , PDF forms
4.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
May 09, 2023 May 09, 2023

No, I don't get any error.

Balance field is formatted to two decimals, and it shows correct for me, but if you click in a field it will show real value of "96064.55000000005".

If you wish to round real value to two decimals, then use a custom calculation script like this:

var a = Number(this.getField("BaseContractAmount").valueAsString);
var b = Number(this.getField("AmountfromPreviousRequest").valueAsString);
var c = Number(this.getField("AmountoftheCurrentPayment").valueAsString);
var total = a-b-c;
event.value = total.toFixed(2);

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 09, 2023 May 09, 2023

Share your file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2023 May 09, 2023

Apologies.  Here is the file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2023 May 09, 2023

Works fine for me:

Izrezak.PNG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2023 May 09, 2023

If you put a payment in the This Payment box of the balance due, it will error out.  I believe it is because of all the decimals added.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2023 May 09, 2023

I'm still not getting any errors.

What software version do you use?

Did you test the file in both DC and Reader?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2023 May 09, 2023

On your first line, if you enter the balance due to the this payment box, you do not receive an error and it resolves to $ 0.00?

I'm using Pro, but there are customers who are using Reader.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2023 May 09, 2023

No, I don't get any error.

Balance field is formatted to two decimals, and it shows correct for me, but if you click in a field it will show real value of "96064.55000000005".

If you wish to round real value to two decimals, then use a custom calculation script like this:

var a = Number(this.getField("BaseContractAmount").valueAsString);
var b = Number(this.getField("AmountfromPreviousRequest").valueAsString);
var c = Number(this.getField("AmountoftheCurrentPayment").valueAsString);
var total = a-b-c;
event.value = total.toFixed(2);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2023 May 09, 2023
LATEST

Genius, Nesa!!  I don't know why the real value shows all the decimals, but your custom calculation script works!    Thank you so much!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines