I am passing 12345678.02 and I wanted to get value after decimal i.e "02" and then i do have the another text file wanted to replace the value.
<add key="BuildVersion" value="12345678.01" />
by.
<add key="BuildVersion" value="12345678.02" />
I wrote the bellow code but it always gives me Echo is off.
set/p pass="%pass%"
set "number_to_round=%pass%"
for /f "tokens=1,2 delims=." %%a in ("%number_to_round%") do (
set first_part=%%a
set second_part=%%b
)
set second_part=%second_part:~0,1%
echo %second_part%
if defined second_part if %second_part% GEQ 5 (
set /a rounded=%second_part%+1
) else (
set /a rounded=%second_part%
)
echo %rounded%>newVersionbeafterdecimal.txt