Results 1 to 3 of 3

Thread: Rounding currency to nearest 5cents [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Location
    Wollongong. NSW. Australia
    Posts
    470

    Thumbs up 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:
    1. Dim temp As Currency
    2.    temp = TotalCost * 10 - Int(TotalCost * 10)
    3.    If temp < 0.5 Then
    4.      TotalCost = TotalCost - temp/10
    5.    ElseIf temp > 0.5 Then
    6.       TotalCost = Round(TotalCost + 0.05, 1)
    7.    End If
    Peter
    Last edited by Supremus; Jun 21st, 2005 at 01:58 AM.
    My reputation is in tatters. Don't bother trying to repair it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width