rounding numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ybhag
    New Member
    • Oct 2006
    • 4

    rounding numbers

    I would like to know how to round numbers. If the number is greater or equal to then 10028.50 then it should should 10029
    thanks
  • Dawoodoz
    New Member
    • Oct 2006
    • 14

    #2
    I dont remember the exact word but i can look it up if you dont have the MSDN discs. "int" is the floor but you wanted the roof if I understand.

    Comment

    • Clay Soyle
      New Member
      • Oct 2006
      • 7

      #3
      Try this:

      Num = 1234.56

      Num = Int(Num + 0.5)

      Hope this helps,
      Clay Soyle

      Comment

      • scripto
        New Member
        • Oct 2006
        • 143

        #4
        In VB use the Round() function - easier.

        Comment

        • Hemant Pathak
          Recognized Expert New Member
          • Jul 2006
          • 92

          #5
          Hi............. ............... .

          Private Sub Command1_Click( )
          Dim a As Double
          a = 1230.51
          Debug.Print Round(a, 0)
          Ans=1230
          a = 1230.5
          Debug.Print Round(a, 0)
          Ans=1231
          End Sub

          Comment

          Working...