Created
September 23, 2021 15:16
-
-
Save lil5/c0999049084f4d20064b3b92f22659a6 to your computer and use it in GitHub Desktop.
Dart MM:SS format
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
class Utils { | |
static String timeMinutesSeconds(int totalSeconds) { | |
int minutes = (totalSeconds / 60).truncate(); | |
int seconds = minutes % 60; | |
return "$minutes:${seconds.toString().padLeft(2, '0')}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment