We have a form that multiplies a purchase price by a sales tax and surcharge rate, then adds the three numbers together.
In the example attached, the actual product of the purchase price times the sales tax is $598.104; and the product of the purchase price times the surcharge is $24.921. When the numbers are added, the total is $17,237.03 but it should be $17,237.02.
Can anyone help with how to round both the sales tax and surcharge, so that the total will be correct?
rounding
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Re: rounding
change actions to:
Sales Tax (3.6%)
Surcharge (0.15%)
Sales Tax (3.6%)
Code: Select all
event.value = (Number(this.getField("purchasePrice").valueAsString) * 0.036).toFixed(2);
Code: Select all
event.value =(Number(this.getField("purchasePrice").valueAsString) * 0.0015).toFixed(2);
It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
- Tracker Supp-Stefan
- Site Admin
- Posts: 17824
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: rounding
Hello Ovg,
Many thanks for the suggestions!
@msbask99 - please do let us know if the above helps!
Kind regards,
Stefan
Many thanks for the suggestions!
@msbask99 - please do let us know if the above helps!
Kind regards,
Stefan
Re: rounding
2msbask99
, You're welcome!
, You're welcome!
It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64