Created
September 28, 2017 20:34
-
-
Save camerican/2b0db459f8e8064645c150a693b37478 to your computer and use it in GitHub Desktop.
Utility functions
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
//convert duration from milliseconds to human-readable Minute:SS display: | |
function convertDuration(duration){ | |
let seconds = Math.ceil(duration / 1000); | |
return parseInt(seconds/60) + ":" + ("0"+seconds%60).slice(-2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment