I am new to the programming world. I understand integer division however my problem is why when you use integer division and the divisor is one is the result being rounded vice the integer value of the division.
For, example when I enter the following code.
Dim intCommission as Integer
intCommission = 2.78 \ 1
me.uiCommissionLabel.text = intCommission
VB.Net returns a result of 3 vice 2 in the commission label
Was wondering if any one could explain this to me or lead me to correcting this problem. Thanks!
2.78 is getting rounded to the nearest integer value (3) when assigned to an Integer. If the value were 2.4, it would be rounded to 2. If you want to simply discard the fractional portion, use the Int() or Fix() functions.