Home › Forum › Formula and Condition Editor › Rounding Up or Down › Re: Rounding Up or Down
Here is an example of how to round up. In other words 1.4 will become 1.5 and 1.6 will become 2.0, etc…
You need two hidden helper fields. I called them “Location of .” and “value after .” When the numeric input field changes data create a behavior. Start with a Set Field. Set “location of .” with an Index Of function (Text = numeric input, Search for the “.”). Next use another Set Field. Set “value after .” with a Sub Text 1 function (Text = numeric input, start index = “location of .” field and end index = 99). Next use a Simple Branch with the condition (“value after .” is less than or equal .5)
If TRUE use a Set Field to set the value of the numeric input using a Sub Text 1 function (Start index =-1 and end index = value of “location of .”) Then use another Set Field to set the value of the numeric input to numeric input + .5
If FALSE use a Set Field to set the value of the numeric input using a Sub Text 1 function (Start index =-1 and end index = value of “location of .”) Then use another Set Field to set the value of the numeric input to numeric input + 1