Rounding Up

Optuma Forums Optuma Scripting Rounding Up

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #52623
    AvatarSteve
    • Topics: 4
    • Replies: 4
    • Posts: 8

    Good day, I would like to round numbers up regardless of lesser value. For example 7.2 rounded would equal 8.  7.8 would also = 8.

    I can’t currently see a way of doing this in scripts. Would anyone have an answer?

    Many thanks

    Steve

    #52627
    AvatarMichael
    • Topics: 3
    • Replies: 6
    • Posts: 9

    Maybe you could add 0.5 to the value and then round? Then, if V < 0.5 it will always be rounded up. If V > 0.5, it will always be rounded down.

    #52631
    MathewMathew
    • Topics: 28
    • Replies: 1,235
    • Posts: 1,263

    We also have a “Floor()” function which rounds down – but not a “Ceiling()” function. You could put your result in c1 and then add 1 to it

    eg

    c1 = {your result};
    Round(Floor(c1) + 1)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close