Nylex/Steve,
This one will round to (the nearest of) any number:
+++++++
Public Function RoundPrice( _
origPrice As Double, _
Optional nRoundTo As Double = 0.05 _
) As Double
If nRoundTo = 0 Then
'No rounding
RoundPrice = origPrice
Else
RoundPrice = _
Round(origPrice / nRoundTo, 0) * nRoundTo
End If
End Function
+++++
Regards
Jacob
| Nylex,
|
| Here is an example of a function you can use to round a currency amount
| to the nearest 5 cents.
|
| Public Function RoundTo5(amnt)
| Dim TotalCents As Integer
| Dim RoundCents As Integer
| TotalCents = (amnt - Fix(amnt)) * 100
| If (TotalCents Mod 5) > 2 Then
| RoundCents = 5
| Else
| RoundCents = 0
| End If
| RoundTo5 = Fix(amnt) + (((TotalCents \ 5) * 5) + RoundCents) / 100
| End Function
|
| --
| Steve Schapel, Microsoft Access MVP
|
| Nylex wrote:
| > I have had so much success from this site that I am now feeling very
| > adventorous
| >
| > Based on Purchase Price, Discount, Freight and MarkUp required I
caluclate a
| > selling price - the field is "SalePrice" dim is as Currency
| >
| > What I would like to be able to do is make the Selling price finish in
| > either a 0 or a 5
| >
| > Tks
| >