AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

convert value into minutes and seconds

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
gr8



Joined: 24 Jul 2007
Posts: 20

PostPosted: Fri Jul 27, 2007 6:52 am    Post subject: convert value into minutes and seconds Reply with quote

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
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Fri Jul 27, 2007 7:35 am    Post subject: Reply with quote

Quote:
what is the way to do it?
Math.
Back to top
gr8



Joined: 24 Jul 2007
Posts: 20

PostPosted: Fri Jul 27, 2007 7:57 am    Post subject: Reply with quote

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
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Fri Jul 27, 2007 8:33 am    Post subject: Reply with quote

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. Cool
Back to top
gr8



Joined: 24 Jul 2007
Posts: 20

PostPosted: Fri Jul 27, 2007 3:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dippy46



Joined: 06 Jul 2004
Posts: 171
Location: Manchester, England.

PostPosted: Fri Jul 27, 2007 5:31 pm    Post subject: Min/Sec Problem Reply with quote

@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
View user's profile Send private message
gr8



Joined: 24 Jul 2007
Posts: 20

PostPosted: Fri Jul 27, 2007 9:10 pm    Post subject: Reply with quote

@dave

many thanks for your help. thats the perfect solution!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group