Today i have question about leading zero in formula.

How to do that?

I do simple work time timer, and want to format output: 00:00:00

Code: Select all

```
[Rainmeter]
Update=25
AccurateText=1
DynamicWindowSize=1
[Variables]
FontSize=12
HoursStart=11
HoursEnd=19
MinutesStart=30
MinutesEnd=30
TextSwitch=""
LabelColor=0,0,0,0
[GetCurrentHour]
Measure=Time
Format=%H
[GetCurrentMinute]
Measure=Time
Format=%M
[GetCurrentSecond]
Measure=Time
Format=%S
[TimeToDigits]
Measure=Calc
DynamicVariables=1
Formula=(GetCurrentHour+(((GetCurrentMinute*60)+GetCurrentSecond)/3600))
[TimeToDigitsStart]
Measure=Calc
DynamicVariables=1
Formula=(#HoursStart#+(((#MinutesStart#*60)+0)/3600))
[TimeToDigitsEnd]
Measure=Calc
DynamicVariables=1
Formula=(#HoursEnd#+(((#MinutesEnd#*60)+0)/3600))
[TimeRemaining]
Measure=Calc
DynamicVariables=1
Formula=(TimeToDigits-TimeToDigitsEnd)*-1
IfConditionMode=1
IfCondition=TimeToDigits > TimeToDigitsStart && TimeToDigits < TimeToDigitsEnd
IfCondition2=TimeToDigits > TimeToDigitsStart && TimeToDigits < TimeToDigitsEnd
IfTrueAction=!RainmeterSetVariable TextSwitch "Work Time"
IfTrueAction2=!RainmeterSetVariable LabelColor 230,40,100,255
IfFalseAction=!RainmeterSetVariable TextSwitch "Rest Time"
IfFalseAction2=!RainmeterSetVariable LabelColor 50,225,150,255
[NumbersToTimeHours]
Measure=Calc
DynamicVariables=1
Formula=Floor(TimeRemaining)
[NumbersToTimeMinutes]
Measure=Calc
DynamicVariables=1
Formula=Floor((Frac(TimeRemaining)*3600)/60)
[NumbersToTimeSeconds]
Measure=Calc
DynamicVariables=1
Formula=(((Floor((Frac(TimeRemaining)*3600)/60))*60)-(Frac(TimeRemaining)*3600))*-1
[TitleBackground]
Meter=Shape
X=5
Y=5
DynamicVariables=1
Shape=Rectangle 0,0,100,25,1 | Fill Color #LabelColor# | StrokeWidth 1 | Stroke Color 255,255,255,100
[AllBackground]
Meter=Shape
X=5
Y=32
DynamicVariables=1
Shape=Rectangle 0,0,100,25,1 | Fill Color 35,35,35,255 | StrokeWidth 1 | Stroke Color 255,255,255,100
[TextTitle]
Meter=String
MeasureName=NumbersToTimeHours
MeasureName2=NumbersToTimeMinutes
MeasureName3=NumbersToTimeSeconds
X=22
Y=7
FontFace=Calibri
FontEffectColor=0,0,0,255
FontColor=255,255,255,255
FontSize=#FontSize#
DynamicVariables=1
AntiAlias=1
LeftMouseUpAction=!RainmeterRefresh
Text=#TextSwitch#
[TextRemainingTime]
Meter=String
MeasureName=NumbersToTimeHours
MeasureName2=NumbersToTimeMinutes
MeasureName3=NumbersToTimeSeconds
X=10r
Y=8R
FontFace=Calibri
FontEffectColor=0,0,0,255
FontColor=255,255,255,255
FontSize=#FontSize#
DynamicVariables=1
AntiAlias=1
LeftMouseUpAction=!RainmeterRefresh
Text=%1:%2:%3
```