Tax Rate

If a user changes the value of the Tax Amount field, then the Tax Rate and Line Total is calculated automatically.

This calculation uses the CalcLineTotalWithOutTax value as input.

The following calculations are performed.

if (taxAmount < 0) taxAmount = 0; <= Means that if user set negative value for “Tax Amount” to avoid dividing by zero the application set value equals 0 for “Tax Amount”

Then the:

“Line Total” = CalcLineTotalWithOutTax + “Tax Amount”

Next, the Difference of Line Total is calculated:

“Line Total” / CalcLineTotalWithOutTax

Next, the Integer part of Difference of Line Total is calculated:

Integer part of Difference of Line Total

Lastly, the Tax Rate is calculated as follows:

“Tax Rate” = (“Difference of Line Total” - “Integer part of Difference of Line Total”) * 100.00