Skip to content

Instantly share code, notes, and snippets.

@DavidGoussev
Forked from anonymous/index.html
Created January 17, 2016 21:09
Show Gist options
  • Select an option

  • Save DavidGoussev/02fc5d8649b3c3b4569d to your computer and use it in GitHub Desktop.

Select an option

Save DavidGoussev/02fc5d8649b3c3b4569d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/zutuniy
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p id="text"></p>
<script>
var filterTimeCode = function filterTimeCode(timeInSeconds) {
var totalSeconds = parseFloat(timeInSeconds);
var minutes = Math.floor(totalSeconds / 60);
var seconds = Math.floor(totalSeconds % 60);
return minutes + ':' + seconds;
};
document.getElementById("text").innerHTML = filterTimeCode(101.43);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment