Examples of use - Numbers steps
This is an example that shows how to use the following steps:
- Truncate Number Step
- Increase Decrease Variable Step
- Convert Number To Text Step
- Convert Text To Number Step
For this example, we create one decimal variable with value 1.87.
Truncate Number Step
We will be rounding off a decimal number with two decimal places to one decimal place.
After running the process, our decimal variable now has a new value of 1.9. Additionally, we extract the integer part as IntPart, which has a value of 1, and the decimal part as integer variable DecimalPart with a value of 87.
Input and Output variables:
Increase Decrease Variable Step
We will now add 3 to our IntPart, making the new value 4 with "Increase Decrease Variable Step".
Input and Output variables:
Convert Number To Text Step
If you want to convert our IntPart to new string variable, you can use "Convert Number To Text Step". Now new variable StringVariable has string value "4".
Input and Output variables:
Convert Text To Number Step
To convert a string variable to a number, you can use the "Convert Text To Number Step". For instance, if you have a string "4" that you want to convert to the number 4, you can use this step and save the result as a variable called DemoVariable. Please note that although the initial value of DemoVariable was also 4, running this process will override its value.
Input and Output variables:
Check variables values
If you want to view the values of your variables after process execution, you can check the process outputs by pressing Ctrl + 0 or clicking on the icon Process Output and choosing Variables.