I'm sorry Nick, I seem to be really bad at math, as I've tried all the setups I can and I either get a really large negative or the decimal moves way to far over. Would you mind showing me the correct way to put this into the note to show the minutes:seconds:milliseconds?
Amended on Sun 21 Oct 2007 04:30 AM (UTC) by Nick Gammon
Message
The basic idea is to take the number and divide by 60 to give minutes, then take the integer amount (I forget the exact function name, it might be Floor or Int) and then multiply it back. To take your example:
72.233719 / 6 = 1.20389531667
Take integer amount = 1 (ie. 1 minute)
Multiply it back: 1 * 60 = 60 (ie. that minute was 60 seconds)
Subtract from original: 72.233719 - 60 = 12.233719
That is now your seconds and fractions of a second.
There is a formatting function or you could multiply by 100 and divide back, eg.
12.233719 * 100 = 1,223.3719
Take integer amount = 1,223
Divide by 100 again: 1,223 / 100 = 12.23
That got rid of the other decimal places.
If you happen to have more than 60 minutes you can repeat the technique to get hours.
Using this code, I am able to get the seconds and milliseconds just fine, but they do not transfer over to minutes if that much time has passed. Also, sometimes the milliseconds expand out 6 spaces, which is annoying. Does anyone know how I can adjust this?
Example of what it looks like: <72.233719>
Example of what I want it to look like: <1:12:23>
That prompt script looks very....very familiar.
Possibly ever looked at, or have my or Batista's MUSHclient system??
Yes, I am a criminal.
My crime is that of curiosity.
My crime is that of judging people by what they say and think, not what they look like.
My crime is that of outsmarting you, something that you will never forgive me for.
Quote: Is there a way to possibly set this up in VBscript? I would just need the Time with the milliseconds if possible.
Stolen from aspalliance.com:
Quote: To time to millisecond accuracy you need to use a little known VBScript function called, of all things, Timer(). The Timer() function returns the number of milliseconds between 00:00 (12:00 AM Midnight) and the time it's called.
Dim dblTimer
dblTimer = Timer()
For i=0 to 100000
Next
Response.Write PrintInterval(Timer() - dblTimer)
It is much easier to fight for one's ideals than to live up to them.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.