Sha256: 009c6e2ca4d83287c2b402407b6b833874cab031d99b56281cbd8bb25023ca1a
Contents?: true
Size: 407 Bytes
Versions: 29
Compression:
Stored size: 407 Bytes
Contents
module Lono::Utils module PrettyTime # http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby def pretty_time(total_seconds) minutes = (total_seconds / 60) % 60 seconds = total_seconds % 60 if total_seconds < 60 "#{seconds.to_i}s" else "#{minutes.to_i}m #{seconds.to_i}s" end end end end
Version data entries
29 entries across 29 versions & 1 rubygems