24.06.2018, 22:46
You're trying to make a float, work with integer in your format, so that will throw out incorrect results in the first instance.
You need %f when dealing with floats, not %i (Integer).
You need %f when dealing with floats, not %i (Integer).