Legacy Dev Forum Posts

 View Only

Sign Up

Roundup Expression with Script

  • 1.  Roundup Expression with Script

    Posted 06-05-2025 19:12

    LouisDAmbrosio | 2022-06-13 20:44:05 UTC | #1

    Hello,

    I am trying to know if there is a way to roundup a decimal number in a script. Agents use a script to transfer interactions. In this script, we retrieve the estimated wait time which is in seconds. We divide by 60 to convert to minute. However, it can result in decimal numbers. Is there a way to roundup the number using a math expression in the script?


    Anton_Vroon | 2022-06-14 02:09:14 UTC | #2

    From here: https://help.mypurecloud.com/articles/dynamic-script-variables/ You can use these: https://mathjs.org/docs/reference/functions.html

    Which includes [math.round(x [, n])] - Round a value towards the nearest integer.

    Used like: round(20.56,0) which would result in 21 or ceil(20.26) which will also result in 21


    system | 2022-07-15 02:07:29 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 15134