Wrong string:
Code:
currenttimeN = (timeH / 24) + (timeM / 1440);//gives the time of day as a percent or 1 (1 = one complete day) so always less than 1
could be:
Code:
currenttimeN = (timeH *60 + timeM) / 1440;
How can you compare part of day and price?