I've searched all the previous Questions regarding 'Rounding' and could not find an answer to my problem.
I have to calculate a number of points based on the difference between two sales totals. The points are calculated as follows...
For each $1000 difference in sales between current year and last year, 100 points are awarded.
So if the difference is...
$900 - Points = 0
$1000 - Points = 100
$1500 - Points = 100
$2200 - Points = 200 etc..
I'm running a report so I have to call a function. The function takes in the difference and returns the points. Any suggestions as to how I can calculate the points correctly? I have to round down the difference to ensure that for example, $999.99 does not round to $1000 and calculate 100 points. This is what I have so far but I'm not able to get it to round down.
I have to calculate a number of points based on the difference between two sales totals. The points are calculated as follows...
For each $1000 difference in sales between current year and last year, 100 points are awarded.
So if the difference is...
$900 - Points = 0
$1000 - Points = 100
$1500 - Points = 100
$2200 - Points = 200 etc..
I'm running a report so I have to call a function. The function takes in the difference and returns the points. Any suggestions as to how I can calculate the points correctly? I have to round down the difference to ensure that for example, $999.99 does not round to $1000 and calculate 100 points. This is what I have so far but I'm not able to get it to round down.
Code:
Public Function GetPoints(Difference As Double) As Integer
If Difference > 0 Then
i = Difference / 1000
If Not i < 1 Then
i = FormatNumber(i, 0)
i = i * 100
GetPoints = i
Else
GetPoints = 0
End If
Else
GetPoints = 0
End If
End Function