Arithmetic Operation
Posted: 12 Apr 2020 21:39
Type1:
@echo off
set CURRMonth=09
set /a CURRMonth+=1
echo %CURRMonth% > Output.txt
exit
Output is: 1
Type2:
@echo off
set CURRMonth=9
set /a CURRMonth+=1
echo %CURRMonth% > Output.txt
exit
Output is: 10
What I am trying to solve is, no matter how many number of '0' assigned infront of the value the result should be the same
so even if I give CURRMonth=9 or CURRMonth=09 or CURRMonth=009 it should give the same result 10. Is it possible?
@echo off
set CURRMonth=09
set /a CURRMonth+=1
echo %CURRMonth% > Output.txt
exit
Output is: 1
Type2:
@echo off
set CURRMonth=9
set /a CURRMonth+=1
echo %CURRMonth% > Output.txt
exit
Output is: 10
What I am trying to solve is, no matter how many number of '0' assigned infront of the value the result should be the same
so even if I give CURRMonth=9 or CURRMonth=09 or CURRMonth=009 it should give the same result 10. Is it possible?