Created
October 25, 2019 19:57
-
-
Save remainstheday/f205cd675df602f5ee29d3bea2c26d24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeConvert(n) { | |
var num = n; | |
var hours = (num / 60); | |
var rhours = Math.floor(hours); | |
var minutes = (hours - rhours) * 60; | |
var rminutes = Math.round(minutes); | |
return num + " minutes = " + rhours + " hour(s) and " + rminutes + " minute(s)."; | |
} | |
console.log(timeConvert(200)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment