whenever i divide a number by a number more than it (e.g 40 / 100) vb comes up with the answer 0. is there a way of stopping this and making 40 / 100 = 0.4, not 0?
Printable View
whenever i divide a number by a number more than it (e.g 40 / 100) vb comes up with the answer 0. is there a way of stopping this and making 40 / 100 = 0.4, not 0?
Sounds like you are using Integer division instead of decimal division....
consider the following.
VB Code:
Dim DecimalDivision As Double = 40 / 100 Dim IntegerDivision As Double = 40 \ 100 MessageBox.Show(DecimalDivision.ToString) MessageBox.Show(IntegerDivision.ToString)
thanks it works now