I'm trying to do Integer division () by 0.25 but VB is telling me I tried to divide by zero, I also tried dividing by (1/4).
This is my snippet
AmountLeft = Remainder \ 0.25
lblQuartersAmount.Text = AmountLeft
You can't do integer division by a non-integer; just truncate and cast it afterwards.
AmountLeft = CInt(Math.Truncate(Remainder / 0.25))
And what's wrong with * 4? =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With