Simple batch file help

BikerEcho

Fully Optimized
Messages
4,029
Location
Denmark
I am trying to make a small batch file that calculate some stuff.

i am having trouble with this line of code: set /a result= %Minutes% / 300
echo %Minutes%

It will not show digits. like if the result is 3,20 it will only show 3. how can i get the ,20 in the result?

also if you have a line of code that can take the %time% and place the hours into one variable and minutes into another variable.
right now i am typing in the hours and minutes into 2 variable manually every time.
 
Calculations in batch files aren't impossible but they are complicated because, as you discovered, standard batch math can only work with whole numbers and no decimals. You can google for examples on how to do it but it's pretty involved. I'd suggest using a more robust scripting language such as Python to do it.
 
Back
Top Bottom