You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
TEXT
This function converts a value of another data type into a string data type.
Syntax
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. The defaults are as followed:
- boolean - true;false
- integer - no default format, the complete integer is set as string (no leading zeros)
- number - rounded to one digit
- percentage - rounded to one digit
- currency - rounded to one digit
- date - yyyy-MM-dd
- datetime - yyyy-MM-dd hh:mm:ss
For more info on date and datetime formats, please see Date and time 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.456. 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.