This code works fine.
the result is
4:45.0
how to get rid of 0?
I hope the result looks like
04:45
Thank you in advance.
set runTime 150
set b 02:15
set b1 [split $b :]
#set b2 [expr {[lindex $b1 0]*3600 + [lindex $b1 1]*60}]
set b3 [lindex $b1 0]
set b4 [lindex $b1 1]
#set result [clock format $b2 -format %k:%M]
set runTimeMin [expr fmod($runTime,60)]
set runTimeHour [expr int($runTime)/60]
#set fullRunTime "$runTimeHour:$runTimeMin"
set result1 [expr {$b3+$runTimeHour}]
set result2 [expr {$b4+$runTimeMin}]
puts "$result1:$result2
the result is
4:45.0
how to get rid of 0?
I hope the result looks like
04:45
Thank you in advance.
set runTime 150
set b 02:15
set b1 [split $b :]
#set b2 [expr {[lindex $b1 0]*3600 + [lindex $b1 1]*60}]
set b3 [lindex $b1 0]
set b4 [lindex $b1 1]
#set result [clock format $b2 -format %k:%M]
set runTimeMin [expr fmod($runTime,60)]
set runTimeHour [expr int($runTime)/60]
#set fullRunTime "$runTimeHour:$runTimeMin"
set result1 [expr {$b3+$runTimeHour}]
set result2 [expr {$b4+$runTimeMin}]
puts "$result1:$result2