I need to convert numbers to a flat file format 0.57 becomes 000000000000000057 in this format (padding zeroes) My method
My method
def toAmount18(a):
return str(int(a*100)).zfill(18)
For 0.57 it outputes 000000000000000056
The problem lies in a*100 it outputs 56.99999999999999 instead of 57. Ideas?