I know this is for learning javascript, but since math is so closely tied to programming, i figured there might be a few math geniusses in here.
im currently creating a time system, and im using functions to translate milliseconds to anything else. example:
Code:
_seconds: function() {
return Math.floor(this._milliseconds/60)
}Now as you may already have figured out, once milliseconds reaches 3600, the seconds isnt going back to 0, but keeps building up on 60.
Now my question and request is; is there a smart math formula that can do this, and if so could you show it to me? Or, if theres a smarter alternative, I wouldnt mind knowing it either.
Would greatly appreciate it, because ive kinda hit a roadblock. And the alternative as far as i know, would result in ugly code and alot of micromanaging.
Thanks in advance,