Tip
Short answer: Compute a Number field with number(Text_Field) to turn text into a number. Compute a Text field with Number_Field.toText() to turn a number into text.
When to use this
Use this when a value arrives in the wrong type for what you need, for example a number typed into a text field that you want to add up, or a number you want to join into a text label.
Set it up
To convert text to a number:
- Add a Number field and turn on Is this a computed field?.
- Enter
number(Text_Field), replacingText_Fieldwith your field ID.
To convert a number to text:
- Add a Text field and turn on Is this a computed field?.
- Enter
Number_Field.toText(). - To control the format, add a pattern, for example
Number_Field.toText(".00")for two decimal places orNumber_Field.toText("0000")for leading zeros.
See number and currency expressions and text expressions.
Tip
number() only works when the text holds a plain number, such as "10".