how to always round numbers up

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aussie Rules

    #1

    how to always round numbers up

    Hi,

    Whats the easiest way to round numbers up.

    For example, a calculation that results in a value of 1.3 will round to 1,
    and a calculation that results in 1.8 will round to 2.

    My issue that I want the 1.3 to always round up to 2, as to round down to 1
    results is short supply of stock, which is worse than an over supply.

    My only thoughts is to manually add 0.5 to every number and therefore it
    would have that effect, but is there a better way to do this ?

    Thanks

  • Cor Ligthert[MVP]

    #2
    Re: how to always round numbers up

    Aussie,

    In my idea is what you ask the integer value from X + .99999999999999 99999

    Cor


    "Aussie Rules" <aussie@nospam. comschreef in bericht
    news:eJ8gQFOfIH A.5164@TK2MSFTN GP03.phx.gbl...


    Hi,
    >
    Whats the easiest way to round numbers up.
    >
    For example, a calculation that results in a value of 1.3 will round to
    1, and a calculation that results in 1.8 will round to 2.
    >
    My issue that I want the 1.3 to always round up to 2, as to round down to
    1 results is short supply of stock, which is worse than an over supply.
    >
    My only thoughts is to manually add 0.5 to every number and therefore it
    would have that effect, but is there a better way to do this ?
    >
    Thanks

    Comment

    • Claes Bergefall

      #3
      Re: how to always round numbers up

      Try Math.Ceiling

      /claes

      "Aussie Rules" <aussie@nospam. comwrote in message
      news:eJ8gQFOfIH A.5164@TK2MSFTN GP03.phx.gbl...
      Hi,
      >
      Whats the easiest way to round numbers up.
      >
      For example, a calculation that results in a value of 1.3 will round to
      1, and a calculation that results in 1.8 will round to 2.
      >
      My issue that I want the 1.3 to always round up to 2, as to round down to
      1 results is short supply of stock, which is worse than an over supply.
      >
      My only thoughts is to manually add 0.5 to every number and therefore it
      would have that effect, but is there a better way to do this ?
      >
      Thanks

      Comment

      • Armin Zingler

        #4
        Re: how to always round numbers up

        "Aussie Rules" <aussie@nospam. comschrieb
        Hi,
        >
        Whats the easiest way to round numbers up.
        >
        For example, a calculation that results in a value of 1.3 will
        round to 1, and a calculation that results in 1.8 will round to 2.
        >
        My issue that I want the 1.3 to always round up to 2, as to round
        down to 1 results is short supply of stock, which is worse than an
        over supply.
        >
        My only thoughts is to manually add 0.5 to every number and
        therefore it would have that effect, but is there a better way to do
        this ?

        Math.Ceiling


        Armin

        Comment

        Working...