Forms, fields and formulas

Convert number values to text and text to numbers

Use number(Text_Field) to get a number and Number_Field.toText() to get text.

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:

  1. Add a Number field and turn on Is this a computed field?.
  2. Enter number(Text_Field), replacing Text_Field with your field ID.

To convert a number to text:

  1. Add a Text field and turn on Is this a computed field?.
  2. Enter Number_Field.toText().
  3. To control the format, add a pattern, for example Number_Field.toText(".00") for two decimal places or Number_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".

Related answers