Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
bgColorwhite

TEXT


Converts a value of another data type into a string. 


Syntax

Code Block
TEXT(integer value, [format], [locale])
TEXT(number value, [format], [locale])
TEXT(currency value, [format], [locale])
TEXT(percentage value, [format], [locale])
TEXT(date value, [format])
TEXT(dateTime value, [format])
TEXT(Boolean value, [format])


Inputs

  • value - The value of the data type that is converted to string.

  • format (optional) - The format used for conversion. Format must be enclosed by quotes, e.g. “00.00”.

  • locale (optional) - Locale specifies a combination of language and country. A locale in the option set will override the one that is used as default in the project. Commonly used are en-US, en-GB, nl-NL, nl-BE, fr-FR. The list of language codes can be found here. A list of country codes can be found here.


Default formats

For the TEXT function, the format specifies how the given datatype is converted towards a string. When no format is specified the defaults are as follows:

  • boolean to string - true;false
  • integer to string - no default format, the complete integer is set as string (no leading zeros)
  • number to string - rounded to one digit
  • percentage to string - rounded to one digit
  • currency to string - rounded to one digit
  • date to string - yyyy-MM-dd
  • datetime to string - yyyy-MM-dd hh:mm:ss

For more info on date and datetime formats, please see Date and time formats or patterns


Return type

  • string


Examples

  • TEXT(PERCENTAGE(1.2), “00.00”, “nl-NL”) results in a string value “01,20”

  • TEXT(123456.78,"#0,000","nl-NL") results in 123.456457. A thousand separator has been added, and any digits after the comma are stripped. The thousand separator is a point, as that is the defined in the nl-NL locale.


Back to top