Value(Text, Language)
Text: The string you want to convert to a numeric value.
Language (optional): A string specifying the locale (e.g., “en-US”, “fr-FR”, “de-DE”). If omitted, the app’s default language is used.
Usage of Value function
Convert User Input to a Number
If a user enters a number into a text input, the value will be treated as text. Use the Value() function to convert it to a number for calculations.
Value(TextInput1.Text)
For example:
Value("456") // Returns 456 (as a number)
Value("-789") // Returns -789 (as a number)
Value("0") // Returns 0
Value("123.45") // Returns 123.45
Perform Calculations on Textual Data
If numeric data is stored as text in a data source, you can use the Value() function to enable calculations.
Ensure Proper Data TypeWhen patching or submitting data to a numeric field in a data source, convert text to a number.
Validate Input Before Conversion
Display an error message if the user enters non-numeric text.
If(IsNumeric(txtInput.Text), Value(txtInput.Text), Notify("Please enter a valid number", NotificationType.Error))
You can also use an optional language parameter to specify the locale used for parsing numbers. This is especially useful for handling numbers formatted differently in various regions (e.g., commas as thousand separators or periods as decimal separators).
Parse US-formatted Numbers
Value("1,234.56", "en-US")
Input: "1,234.56" (comma as a thousand separator, period as a decimal separator). Output: 1234.56
Recommended for you
![]()
