I am based out a country, where the decimal place for the currency seems to have lost its value, sad but this is what the recession seem to have done. We use TPSL payment gateway, which doesnt seem to be very popular in other place.
The VAT structure in my country is 5%. In other words if my Gross price for a product is 100, the Net Price becomes 95.23809523809524...!!! This is where it all starts to get interesting

When the Net Price is fed in Product>Data>Price 95.2380 (it takes up to 4 decimal places). In the Invoice in check out price indicated is 100.00 ( I have 2 decimal places set in localization>Currency).
However the math now is
95.2380*1.05 = 99.9999
Which is correctly rounded off to 100.00 in the invoice. However when the information is sent to TPSL Payment Gateways is received as 99.9999 and not 100.00. The PG is not able to process the amount and the payment is declined!
Interestingly, when instead of 95.2380 we us 100 as the net amount.
The Gross amount (100*1.05=) 105 is processed correctly by the payment gateway.
I have concluded, by looking at the payment gateways log that the payment is correctly processed, when the amount is upto 2 decimal places and fails anytime the amount passed to the PG is more than 2 decimal places.
Is there a work around? Should I add a padding to the amount say 0.0001 to 99.9999 to make it 100.00 or is there any other workaround or module?
Any help would be greatly appreciated.