Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
double?
#1
Hi Gintaras!

How would i convert this..

Macro Macro4
Code:
Copy      Help
_s = "0.5" ;; 30 minutes

double _hours = val(_s 2)
double _time = _hours*60*60; out F"{_time} seconds"

to a string format 00:00:00 ? (in this case would be 00:30:00)

Thank you.
#2
Macro Macro1708
Code:
Copy      Help
_s = "0.5" ;; 30 minutes

double _hours = val(_s 2)
DATE _time = _hours/24
_s.timeformat("{TT} seconds" _time)
out _s
#3
wouldnt it out "12:30:00 AM seconds" if timezone isnt europe or familiar?
#4
sry typos meant similar* not familiar.
#5
_s.timeformat("{HH:mmConfuseds} seconds" _time)
#6
yes, i looked up the character sequences in qm help and had same result. Big Grin

Have a nice weekend.

best regards
#7
so im limited to _s="23.9" ?

problem is i recieve a certain amount of hours in format 0.0 so it could be 30.5 (30 and a half hr.) aswell.
#8
Macro Macro1709
Code:
Copy      Help
_s = "0.5" ;; 30 minutes
_s = "30.5"

double x = val(_s 2)
int hours=x
int minutes=x*60%60
int seconds=x*60*60%60
_s.format("%02i:%02i:%02i seconds" hours minutes seconds)
out _s
#9
Fantastic! that does it.

Cant thank you enough! Now i can call it a weekend.

Thank you very much Sir.


Forum Jump:


Users browsing this thread: 1 Guest(s)