In my attached sample file you can see I am trying to calculate the tax amount by multiple rate and tax base amount, then use it to minus output tax. I use the round to keep 2 decimals but why I still have the difference for line 2? Is this a bug?
Rate | Output tax | Tax base amount | Tax Amount | Difference | round value | round difference |
20 | (88.32) | (441.60) | (88.32) | 0.00 | (88.32) | (0.00) |
20 | (1,094.1000000000) | (5,470.52) | (1,094.1040000000000) | (0.0040000000001) | (1,094.1000000000) | (0.00000000000023) |
Hi,
One simple approach it to change your types from double to FixedDecimal (precision 19 Scale 2) for the columns you are creating in the foumula tool.
When I idd, i get this:
Rate Output tax Tax base amount Tax Amount Difference round value round difference
20 -88.32 -441.6 -88.32 0.00 -88.32 -0.00
20 -1094.1 -5470.52 -1094.10 -0.00 -1094.10 -0.00
☝️ What @Clifford_Coon said. Computers aren't good at decimals, they're good at binary. Use a Fixed Decimal (Precision ≈ 19 and Scale = 2) to only show the first two decimal places.