Skip to main content
Participant
September 15, 2016
Answered

Form Question: How to get the percent calculated?

  • September 15, 2016
  • 1 reply
  • 443 views

Hello!

I have a form that is a invoice like form. I am able to get the pre-tax total, then plug in the percent tax amount (it varies by county, so it can't be a static number), then the addition of the pre-tax total plus the tax. HOWEVER, I need to also know what that percent tax total is in $ form.

For example:

BOX A - Pre-Tax Total: $10.00 (calculated by form from the total above in the form)

BOX B - Tax percent: 10% (filled in by user)

BOX C - Total including tax: $11.00 (calculated from above)

What I also need is:

BOX - Tax total: $1

Final Form:

BOX A - Pre-Tax Total: $10.00

BOX B - Tax percent: 10%

BOX C - Tax total: $1

BOX D - Total including tax: $11.00

THANKS!

This topic has been closed for replies.
Correct answer try67

Is Box B an actual Percentage field, or is it just a Number field?

If the former, as the custom calculation script of Box C enter:

event.value = Number(this.getField("Box A").value) * Number(this.getField("Box B").value);

If it's the latter then use this code:

event.value = Number(this.getField("Box A").value) * (Number(this.getField("Box B").value)/100);

Then set the calculation of Box D to be the sum of Box A and Box C.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 15, 2016

Is Box B an actual Percentage field, or is it just a Number field?

If the former, as the custom calculation script of Box C enter:

event.value = Number(this.getField("Box A").value) * Number(this.getField("Box B").value);

If it's the latter then use this code:

event.value = Number(this.getField("Box A").value) * (Number(this.getField("Box B").value)/100);

Then set the calculation of Box D to be the sum of Box A and Box C.

MKV_LBUSDAuthor
Participant
September 16, 2016

Worked great! Thanks for the quick reply!