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
-
- User
- Posts: 461
- Joined: Tue Sep 05, 2017 4:56 pm
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);
You do not have the required permissions to view the files attached to this post.
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
-
- Site Admin
- Posts: 17949
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
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
-
- User
- Posts: 28
- Joined: Wed Jul 22, 2020 9:01 pm
-
- User
- Posts: 461
- Joined: Tue Sep 05, 2017 4:56 pm
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