There is a concept problem, in case 2 hours and 30 minutes should floating point be represented as 2.50 this because 1 hour which in the case is evaluated as 1.0 floating point are 60 minutes, starting from this principle 30 minutes should equivalent to 0.5 being thus 2 hours and 30 minutes == > 2.50 and not 2.30 as pointed out above!
Using rule of 3 you convert based on minutes (if accuracy is in minutes) simply convert the period in minutes.
02:30 (two hours and thirty minutes) == > 150 minutes
in rule 3
The ratio 1 to 60, ie 1 in floating point equals sixty minutes
and obtain the floating point value equivalent to the one to be converted (150 minutes) considering the established ratio, thus obtaining the expression below
60X = 150*1 ==> X = 150/60 ==> X = 2,50