Rounding Problems Converting Hours Minutes Seconds (H.MS) to Hours (H.HH)

deetee:
To solve the problem I used the instructions from johnwasser (thanks very much).
To deal with tenths of a second too (stopwatch) I rounded at the sixth digit (+0.000005). I don't know why, but I have to use a long variable for that - an int doesn't work correctly.

An int can only handle numbers up to 32767. A long can handle up to about 2 billion. Probably something in your calculation was causing the numbers to exceed 32767.

What kind of calculator are you trying to make? Arduino floats only give you 7 or sometimes 8 good digits. Is that enough for you?

Please take a look at: http://floating-point-gui.de/