lib/vidibus/helpers/extensions/view.rb in vidibus-helpers-0.0.2 vs lib/vidibus/helpers/extensions/view.rb in vidibus-helpers-0.0.3

- old
+ new

@@ -26,10 +26,10 @@ # number_to_duration(3654) # => "01:00:54" # number_to_duration(3654, :hours => false) # => "60:54" # def number_to_duration(seconds, options = {}) hours = options[:hours] - seconds = seconds.round + seconds = seconds.to_f.round hour = (seconds / 3600).floor unless hours == false min = (seconds / 60).floor sec = (seconds % 60).round if hours != false and (hours == true or hour > 0) min -= hour * 60