I seem to be having a problem with this bit of code. It is just a smaller portion of the whole image.
set /p amnt=Initial Amount($):
set /p dwn=Down Payment ($):
set /p rte=Interest Rate (%%):
set /a loan=amnt-dwn
set /a interest=loan*(rte/100)
echo %interest%
pause
I don't understand why interest is not displaying the way I want it to. When I input 100 for the initial amount, 90 for the down payment, and a 50 percent interest rate, that leaves 10 dollars to be multiplied by .5, which should result in $5. Or atleast thats what I want it to do. What am I doing wrong, and how can I fix it?
(Note: This code is part of a really poorly written program. Please don't tell me I should be using a different method or condense my calculations. I just want to understand what is wrong in my division/math.
Edit: I just found
"In principle, it is also possible to do multiplication and division.but only whole numbers can be handled so the practical use is limited." So what is a workaround for this?
Winning answer gets $5.
set /p amnt=Initial Amount($):
set /p dwn=Down Payment ($):
set /p rte=Interest Rate (%%):
set /a loan=amnt-dwn
set /a interest=loan*(rte/100)
echo %interest%
pause
I don't understand why interest is not displaying the way I want it to. When I input 100 for the initial amount, 90 for the down payment, and a 50 percent interest rate, that leaves 10 dollars to be multiplied by .5, which should result in $5. Or atleast thats what I want it to do. What am I doing wrong, and how can I fix it?
(Note: This code is part of a really poorly written program. Please don't tell me I should be using a different method or condense my calculations. I just want to understand what is wrong in my division/math.
Edit: I just found
"In principle, it is also possible to do multiplication and division.but only whole numbers can be handled so the practical use is limited." So what is a workaround for this?
Winning answer gets $5.