SEC to minutes

Nope:) 220 sec = 3 and 2/3 minutes, or 3.667 Which you can easily find out by 220 / 60.0 (Make sure you include the .0… forces it to float and keeps the stuff after the decimal point, which 220 / 60 would not)

I think he meant 3 minutes 40 seconds by 3.40 minutes. I think. I wouldn’t have put it that way but the math works.

RSL

Perhaps you mean 220sec => 3:40

class Integer

def to_minutes

“%d:%02d” % [ self/60, self%60 ]

end

end

220.to_minutes

=> “3:40”

-Rob

Rob Biedenharn http://agileconsultingllc.com

Rob@AgileConsultingLLC.com

Ahhh…

Great minds think alike!

RSL