Created
October 2, 2011 10:03
-
-
Save Alfreddd/1257301 to your computer and use it in GitHub Desktop.
convert seconds to the form "10m 20s"
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
def convert_seconds_to_time(seconds) | |
total_minutes = seconds / 1.minutes | |
seconds_in_last_minute = seconds - total_minutes.minutes.seconds | |
"#{total_minutes}m #{seconds_in_last_minute}s" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment