Results 1 to 3 of 3

Thread: Automatic rounding up of number?

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    1

    Automatic rounding up of number?

    hi first time here, i am making a program to calculate postage costs. and on a loop that is in the program when it does the sum of 3.45 + 0.86 it comes up with 4.30 when it should be 4.31

    The loop Code:
    1. Dim extracost As Currency
    2.         Dim loopcost As Currency
    3.         Dim extracostformated As Currency
    4.         Dim loopcostformated As Currency
    5.         loopcost = 3.45
    6.         extracost = 0.86
    7.         loopcostformated = FormatNumber(loopcost, 2)
    8.         extracostformated = FormatNumber(extracost, 2)
    9.         Cost = loopcostformated And Weight = Weight - 1000
    10.         Do While Weight > 0
    11.         Weight = Weight - 250
    12.         Cost = Cost + extracostformated
    13.         Loop
    Last edited by joshbro90; May 15th, 2007 at 02:13 PM.

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