Rounding currency to nearest 5cents [RESOLVED]
G'day,
I have to round a currency total to the nearest 5 cents. Is there an inbuilt function to do it better?
VB Code:
Dim temp As Currency
temp = TotalCost * 10 - Int(TotalCost * 10)
If temp < 0.5 Then
TotalCost = TotalCost - temp/10
ElseIf temp > 0.5 Then
TotalCost = Round(TotalCost + 0.05, 1)
End If
Peter
Re: Rounding currency to nearest 5cents
this seems to work ok
charge = 9.37
mycharge = (CDbl(charge * 100 \ 5)) / 20
pete
Re: Rounding currency to nearest 5cents
G'day Pete,
Sure does, and a lot simpler.
Thanks.