Talk2Tom11
Centurion
Hello I want to convert a money amount into dollars and coins.
for example if i start with $20.35.
it should tell me that i have 20 dollars, 1 quarter, and 1 dime.
I have been working using the mod keyword to hold the remainder but it just isn't coming out right... here is my code.
when i input $20.25... it gives me... 20 dollars, and 0 quarters
???
Does anyone know what i am doing wrong in my code.
If you can help then please post
for example if i start with $20.35.
it should tell me that i have 20 dollars, 1 quarter, and 1 dime.
I have been working using the mod keyword to hold the remainder but it just isn't coming out right... here is my code.
Visual Basic:
intamount = val(txtinput.text)
intamount = dblamount * 100
dollars = intamount \ 100
quarters = intamount mod 100
intamount = intamount \ 100
quarters = intamount \ 25
when i input $20.25... it gives me... 20 dollars, and 0 quarters
???
Does anyone know what i am doing wrong in my code.
If you can help then please post