Wednesday, October 27, 2010

Round time to nearest 30 seconds

I had a requirement to round the time for a video (in seconds) to the nearest 30 seconds. Not being so strong in math, I am grateful to be better at Googling. So here it is for anyone else in a similar situation:

Math.round(myTime/30)*30

Awesome and simple!

No comments:

Post a Comment