Rounding Up in VB Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kenny Joubert
    New Member
    • Aug 2010
    • 1

    #1

    Rounding Up in VB Script

    I am trying to round-up in VBscript but am hitting blanks...

    My script so far is...

    Value = Quantity / Packing
    Value = Int(value + 0.8)

    Quantity and Packing are variables and always needs to round up

    Please help?
  • Joseph Martell
    Recognized Expert New Member
    • Jan 2010
    • 198

    #2
    Interesting article on rounding in VB Script here. To answer your question, and to quote from the referenced article, I think you could use the Fix function. It will always round down (closer to 0) by truncating the decimal portion. If you add 1 to the result of Fix (assuming a positive argument), then you have your numbers rounded up.

    Comment

    Working...