I have a script which returns a decimal value to represent time. I need to convert the decimal time value to hh:mm (i.e: 90 minutes decimal value 1.5 should be represented as 1:30. Having trouble figuring this out. Attached is my current script.
Code:<script> function Convert() { var minutes = document.getElementById("sum").value; var hours = minutes / 60; document.getElementById('total').value = hours; document.getElementById('sum').value = minutes; var convert = function (sum) { return Math.floor(sum/60) + ":" + (sum-Math.floor(sum/60)*60); } </script>


Reply With Quote

Bookmarks