Rounding Up

Optuma Forums Optuma Scripting Rounding Up

This topic contains 2 replies, has 3 voices, and was last updated by Mathew Mathew 1 month, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #52623
    Avatar
    Steve
    • Topics: 3
    • Replies: 4
    • Posts: 7

    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
    Avatar
    Michael
    • Topics: 3
    • Replies: 3
    • Posts: 6

    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
    Mathew
    Mathew
    • Topics: 16
    • Replies: 967
    • Posts: 983

    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