fix MS SQL script error

Job ID: 32229441

Budget: $10 – $30 USD

Hi,

We have a script to calculate Item price and VAT.

We get a wrong result in terms of precision.
IMPORTANT: variable must be the type of decimal(9, 4) and using of TRUNCATE is not allowed
Let's say the unit price Includes tax = 2.1, and Exclude tax = 1.8261,
we need 1000 items so the total cost Includes VAT should be 2100 (Unit price Inc. VAT * Quantity).
Now, let us calculate it by the unit price excluding the VAT.
First, we find the taxable amount which is (Unit price * quantity) is 1826.1
The tax is 15%, so we compute the VAT, which is (taxable amount * tax rate) is 273.9150
Finally, we need to find the total include tax which is (Taxable amount + VAT) the result is 2100.02

That's unexpected! We expect 2100.

How to solve this issue