Rounding up below 1000 to 1000

(Louis Price) #1

I need to round up every number below 1000 to 1000 and every number above 8000 to 8000, I’m assuming you do this in the calculate section? what is the expression?

(Sarah Palombo) #2

HI Louis :wave:

This would be possible using the number service & select Calculate. There are various expressions you can use. this is what is supported - https://mathjs.org/docs/expressions/syntax.html#operators

Out of my remit i’m afraid (not my expertise) :pensive: but i can give an simple example. :+1:

{{ask_a_question.parsed_answer}}<1000

would check if a number was less than 1000 in which case would return ‘yes’ as an output. The output can then be used to filter the next actions.

I guess you could also check again if a number was > than 8000 like so:

{{ask_a_question.parsed_answer}}>8000

I’m sure there’s easier ways maybe a google search might let you steal an example (i couldn’t find one though i’m afraid)

Hope that gets you what you need ( a way to check then filter thereafter)

Sarah