How batch command output remains three figures, if less than 0

Used for testing digital need to fill 0, headache with windows. Finally we found a way.
In fact, if the word: Set "Num = 000% a %" & Set "Num = Num:!! ~ -3"
examples are as follows:

@Echo Off&SetLocal EnableDelayedExpansion
set a=2
Set "Num=000%a%"&Set "Num=!Num:~-3!"
echo %Num%
echo %a%

pause

Guess you like

Origin www.cnblogs.com/bugutian/p/12113534.html
Recommended