| View previous topic :: View next topic |
| Author |
Message |
gr8
Joined: 24 Jul 2007 Posts: 20
|
Posted: Fri Jul 27, 2007 6:52 am Post subject: convert value into minutes and seconds |
|
|
i have a variable with a value that's 42.967633 and i want to show this value in a variable in the mm:ss format. so the result would be 42:58...
what is the way to do it?
many thanks for your help. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Jul 27, 2007 7:35 am Post subject: |
|
|
| Quote: | | what is the way to do it? | Math. |
|
| Back to top |
|
 |
gr8
Joined: 24 Jul 2007 Posts: 20
|
Posted: Fri Jul 27, 2007 7:57 am Post subject: |
|
|
very helpful....
i know it's math but i'd like to know, if there is a function like FormatTime supporting a convertion like this...
thanks anyway. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Jul 27, 2007 8:33 am Post subject: |
|
|
| Quote: | | is there a function like FormatTime supporting a convertion like this... | Thanks to be more specific. Check out the Scripts & Functions Section. I guess I've seen something which fits (optionally slight changes necessary). Good luck.  |
|
| Back to top |
|
 |
gr8
Joined: 24 Jul 2007 Posts: 20
|
Posted: Fri Jul 27, 2007 3:48 pm Post subject: |
|
|
thanks.
do you have a search string? because if i search for date AND converting i get about 20 pages of results... |
|
| Back to top |
|
 |
Dippy46
Joined: 06 Jul 2004 Posts: 171 Location: Manchester, England.
|
Posted: Fri Jul 27, 2007 5:31 pm Post subject: Min/Sec Problem |
|
|
@gr8
| Code: |
v:=42.967633,m:=Floor(v)
s:=Floor((v-m)*60)
MsgBox % m ":" s
|
OR as a Func
| Code: |
MsgBox % MinSec(42.967633)
MinSec(_Dmin)
{
m:=Floor(_DMin)
Return % m ":" Floor((_DMin-m)*60)
}
|
Regards Dave. _________________ Simple ideas lie within reach, only of complex minds |
|
| Back to top |
|
 |
gr8
Joined: 24 Jul 2007 Posts: 20
|
Posted: Fri Jul 27, 2007 9:10 pm Post subject: |
|
|
@dave
many thanks for your help. thats the perfect solution! |
|
| Back to top |
|
 |
|