If I have some JS:
var ct = 1.30;
or it could also be:
var ct = 0.04;
or it could also be:
var ct = 4.45677;
How can I simply change these decimals to whole numbers? i.e.:
30
for the first one
4
for the second one and
46
for the 3rd one?
Is there a JS method I can use to do this?
Here is the code I am working with so far. This works fine for seconds, minutes and hours, but I am left without the frames, which is why I started the process in the first place.
var ct2 = 1.30;
var timestamp = ct2;
var seconds = timestamp % 60;
timestamp = Math.floor(timestamp / 60);
var minutes = timestamp % 60;
timestamp = Math.floor(timestamp / 60);
var hours = timestamp;
This ends up giving me:
Seconds: 1
Minutes: 0
Hours: 0
But leaves me without this key part:
Frames: 30