Copy link to clipboard
Copied
I'm creating a form and I need the code to calculate 6% tax to the price total (field)? Please advice, thank you in advance!
Copy link to clipboard
Copied
Get the field's value and then multiply it by 0.06 ...
Copy link to clipboard
Copied
But how do I code this formula?
Copy link to clipboard
Copied
Do you want to apply the value to a different field, or just use it in your code for something else?
Copy link to clipboard
Copied
Yes I want the value ( the amount of the multiplication) to reflect on the field.
I guess I word it wrong I want to do a multiplication on the tax field for the taxes.
Copy link to clipboard
Copied
I WANT TO MULTIPLY FIELD NAME: SUB TOTAL
THE FORMULA IS SUPPOSED TO BE: SUB TOTAL * 0.06
AND THE ANSWER TO BE REFLECTED ON THE FIELD NAME: PRICE TAXES
I DON'T KNOW HOW TO CODE IT?
Copy link to clipboard
Copied
If you use the simplified field notation option, you could use the folowing
0.06 * SUB\ TOTAL
If the field name didn't have a space in it and were instead "SUBTOTAL", it would be:
0.06 * SUBTOTAL
If you want to use a custom JavaScript option, the calculation script could be:
// Custom calculation script in PRICE TAXES field
(function () {
// Get the field value, as a number
var v = +getField("SUB TOTAL").value;
// Calculate, round to two decimals, and set this field value
event.value = util.printf("%.2f", 0.06 * v);
})();
When you're done setting up the calculated fields, make sure the field calculation order is correct for the form.
Copy link to clipboard
Copied
IT WORKED THANK YOU SO MUCH!!!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now