RPG Maker Forums

Hey guys,

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,

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top