src/js/utils.js
branchpopcorn-port
changeset 256 8e1181b855bd
parent 254 cafaa694b709
child 285 b7aa28af2c10
equal deleted inserted replaced
255:af3adcf7cb20 256:8e1181b855bd
    29   var timetotal = Math.abs(timetotal);
    29   var timetotal = Math.abs(timetotal);
    30   
    30   
    31 	return Math.floor((time/timetotal) * 100);
    31 	return Math.floor((time/timetotal) * 100);
    32 };
    32 };
    33 
    33 
       
    34 IriSP.padWithZeros = function(num) {
       
    35   if (Math.abs(num) < 10) {
       
    36     return "0" + num.toString();
       
    37   } else {
       
    38     return num.toString();
       
    39   }
       
    40 };
    34 /* convert a number of seconds to a tuple of the form 
    41 /* convert a number of seconds to a tuple of the form 
    35    [hours, minutes, seconds]
    42    [hours, minutes, seconds]
    36 */
    43 */
    37 IriSP.secondsToTime = function(secs) {  
    44 IriSP.secondsToTime = function(secs) {  
    38   var hours = Math.abs(parseInt( secs / 3600 ) % 24);
    45   var hours = Math.abs(parseInt( secs / 3600 ) % 24);