Created
January 17, 2016 21:08
-
-
Save anonymous/f5da89124c04a1cd2143 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/zutuniy
This file contains hidden or 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
| <!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