1.

Solve : SET /A Command?

Answer»

Win.XP Home SP.2

How can I get the Set/a command to return the complete value???

Example:

@echo off
cls

set a=1029

set /a b=%a%/2

echo %b%

returns 514 which should (hopefully) be 514.5

Where have I GOT it wrong please???

ThanksYou didnt go wrong .. you can only do integer MATHS, which means that any fraction is dropped off

You could TRY multiplying your number by 10, doing the DIVISION and inserting a '.' to the left of the rightmost digit.Quote from: gpl

you can only do integer maths, which means that any fraction is dropped off

Thank you, I must have missed that very important CONDITION in the SET/? display which I will re-read.



Discussion

No Comment Found