javascript - Convert hours to correct division by 60 minutes -
how convert number such following: 12.82 correct hourly format: 13.22?
this work:
timeold = "12.84"; time = timeold.match(/(\d+)(\.\d+)?/); if (time[2] >= .60) { time[2] = time[2] - .60; time[1] = parseint(time[1]) + 1; } alert(time[1] + time[2]);
Comments
Post a Comment