I have a sql database, it has a column of floats. In it, the value is "4" and it is displayed a "4" while other values are 2.5, 3.6, all have decimals and those seem to function fine for my issue. But the number without a decimal is different.
I have a basic function
Private Function getScore(scoreValue As Double) As String
If (scoreValue = 5) Then
Return "Platinum"
ElseIf scoreValue >= 4 Then
Return "Gold"
ElseIf scoreValue >= 3 Then
Return "Silver"
ElseIf scoreValue >= 2 Then
Return "Bronze"
Else
Return "Unsatisfactory"
End If
End Function
When i pass this "4" that's a float, it returns the "silver" score. How am i to do this function correctly, i can't round the score, so i can't cast it as an integer. I did various debug statements to figure out what was going on and when i output scoreValue - 4 it yielded 4.44089209850063E-16