10 lines
312 B
JavaScript
10 lines
312 B
JavaScript
|
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));
|