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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -