A question regarding seconds and MS

January 24th, 2020

Hello everyone, I have got a question, that I cannot find the answer to, and I am not very skilled in maths(figures )
Now, we all know to get seconds from MS we use /1000
(like 2048 MS /1000 should equal 2 seconds)
Now, My question is this:
is it possible to convert seconds into milliseconds?
so like if i had been a user, and entered 2 seconds, I would then like it to return as 2048 MS.
If it is impossible, then I guess I don’t mind, but its worth a shot asking anyways.
Thank you

Answer #1
Well it would be possible if you did not approximate your result.
1 second = 1000 milliseconds or 1 millisecond = 0.001 seconds
so 2048ms equals 2.048s. Is this what you meant by your question?
Answer #2
hmm, not shore if you understood me?
what I wanted, was some math code(or even maybe php code) that can convert any number of seconds into milliseconds
thanks
Answer #3
so like if i had been a user, and entered 2 seconds, I would then like it to return as 2048 MS.
2 Seconds is not equal to 2048 miliseconds. It is 2000 miliseconds Just multiply the entered number by 1000
Answer #4
oops my mistake there, but the “example” didn’t really have much to do with the question, as the amount of seconds will vary depending on what is entered.
But when ever I search google for anything like “Converting Seconds to Milliseconds” it just returns results about “Converting Milliseconds to Seconds”, and that isn’t much help(P.S. I think with the 2048 thing, I may have been thinking of KB and MB ^.^)
Answer #5
That’s not so difficult is it? The seconds should be entered as floating point value and multiplying that value by a 1000 is the resulting value in milliseconds… 🙂
And yes, I think you got confused by the 1024 bits = 1 KB analogy.
Answer #6
multiply it…
how did I not know that? ..damn math weaknesses
and yea, I usually mix KB, MS, MB, and seconds up..and I bet I am not the only one
P.S. thanks for the info’s
EDIT:
Just multiply the entered number by 1000
oops, didn’t see it, thank you to you(and all who did / tryed to help)
Answer #7
You’re welcome, mate.

 

| Sitemap |