In my project I am converting a euro string numeric, eg 2.55, to an int value in cents, eg 255, I do this by multiplying the string by 100 as below
However I have noticed that the int value ends up as 254 rather than 255 so I expect there is some rounding happening. Is there some way to avoid this in the conversion?
B4X:
dim seuro as string
dim icents as int
icents = seuro*100
However I have noticed that the int value ends up as 254 rather than 255 so I expect there is some rounding happening. Is there some way to avoid this in the conversion?