To locale number action
- Updated: 2023/06/30
To locale number action
The To locale number action in the String package enables you to convert a string to a locale-formatted number.
Settings
- In the Source value field, specify the source string.
- Select any of the following tab to specify locale:
- Specify: Manually specify the two letter ISO codes for the locale you want to use in the Locale field.
- Device: Use the default locale configured for the device.
- In the Save the outcome to a variable list, specify the variable.
You can also use the action in an expression. For example, $prompt-assignment.String:toLocaleNumber("en-US")$.
Example
Create a sample bot and perform the following steps to convert a string
to a locale-formatted number:
- Create a bot.
- On the left panel, click Automation.
A list of available bots and forms is displayed.
- Click Create a bot.
- Enter the bot name: String_localenumber.
- Click Create and Edit.
- On the left panel, click Automation.
- To convert a string to a locale-formatted number, from the
Actions pane, double-click or drag the
action.
- In the Source value field, enter 1,23,345.67
- Select the Specify option and enter en-US in the Locale field.
- In the Save the outcome to a variable field, click the Create variable icon to create a variable.
- On the Create variable window, enter Num_output in the Name field.
- To convert the number to a string, from the Actions pane, double-click or drag the
action.
- In the Enter a number field, select $Num_output$ variable.
- In the Enter number of digits after decimal (number format) field, enter 2.
- In the Assign the output to variable field, click the Create variable icon to create a variable.
- On the Create variable window, enter locale_output in the Name field.
- Click Create and select.
- To print the values, double-click or drag the Message box action. In the Enter the message to display field, enter $locale_output$.
- Click Save and then Run.
The bot now displays the value as 123345.67