Most programming languages can't allocate full float number correctly and so it loses precision.
If you know how many decimal places your number must have, I suggest you to convert to real number and than format it back for floating number.
You can test it with javascript in your browser console by adding 0.1 + 0.7.