Awesome!
I apologize about my initial reply. I made mistakes and below I will explain and illustrate what worked on my end:
- For example: if the tax is 7.5% you cannot add the decimal. It simply rounds it of to the 100th at 7500%! This calculates too much. EG: say your item is $2.00 plus the 7.5% tax should be $0.15 and grand total of $2.15. However, with the invoice if you input 75 (as you cannot put a decimal) it is 7500% making the tax at $1.50 (too much).
I believe that we all failed to explain to you that this is due to how javascript handles floating points , decimal math, and the two types of numbers in modern JavaScript. Refer to links below to get acquainted with these considerations:
- https://modernweb.com/what-every-javascript-developer-should-know-about-floating-points/
- http://adripofjavascript.com/blog/drips/avoiding-problems-with-decimal-math-in-javascript.html
- https://javascript.info/number
And yes you can include a decimal, but it has to be done using a custom format script for that field using util.printf and some parameters.
Okay! So here is my issue now! The script above, Is_rbls did not work but my orginal one does now... ( see post above) I had missed the decimal placement step in configuring. Now however, the amount shows up in the tax percentage?? What's with that? Example: shown with 7.5% tax; It will now allow to type "7.5" but immediately shows the calcualte tax; not 7.5?
- My settings...is there something I'm missing? I'm assuming this is a hopeful easy fix; just been staring at it too long!
Like I said earlier I apologize. I made numerous mistakes, I did not documented myself properly before submitting my reply and was multi-tasking very gullibly answering other threads in the support forums.
The same answer as the first bullet above applies to these questions except that Adobe Acrobat clearly lets the user know that it will multiply by 100 as shown in your slides below your comment.
Try67 explained:
The value of fields with the Percentage option selected under the Format tab is between 0 (0%) and 1 (100%).
So if you want it to show 7.5% you have to enter it as "0.075" (without the quotes).
This, however, shouldn't be the case because your initial inquiry was based on why you can't use the period, and your second inquiry why it was rounding and bumping very high numbers.
These are the scripts that I used:
// THIS IS A CUSTOM FORMAT SCRIPT TO WORK AROUND THE DECIMAL ISSUE
var a = +getField("TAX").value;
event.value = util.printf("%.2s", event.value)+"%";
//THIS A CUSTOM CALCULATION SCRIPT FOR THE SUB TOTAL FIELD
var total= this.getField("SUB TOTAL").value
var tax = this.getField("TAX").value;
event.value = (Math.ceil(total*tax)/100);
//THIS IS A CUSTOM CALCULATION SCRIPT FOR THE GRAND TOTAL FIELD
var subT = this.getField("SUB TOTAL").value
var tax = this.getField("tax").value;
event.value = subT+tax;
NOTE: In the first script I corrected this part "%1.f %"; to "%.2s", event.value)+"%"
The "f" denotes using a floating point number so I switched "s" to print out the format of this number as a string. Doing so eliminates all the troubles in this entire discussion , plus you can add the "%" symbol in the equation and it won't affect the remainder of the other calculated fields that depend on the valu displayed in the Tax field (very valuable discussion by the way!)
So like I said before, this is something I learned from Try67 in a similar thread that he answered for another user not so long ago. I just couldn't find it to post it back here for you to use.
Anyway, I prepared a slide for your consideration. If you decide to use it you're more than welcome.
See below:

One more observation, though, you didn't share with the team how did you resolved the issue.
In my opinion, the work that I just presented is the correct answer to your questions. But I am learning JavaScript and getting used to being somewhat ignored when I join the big boys of Acrobat support forums.
It would mean a world to me if this answer is marked as correct answer.