Learn more about the data type conversion functions TEXT, INTEGER, NUMBER, CURRENCY, PERCENTAGE, DATE, DATETIME, BOOLEAN.
Convert a value of one data type into a value of another data type using conversion functions. The following conversion functions are available:
from string to integer, number, currency, percentage, date, dateTime or
...
Boolean
from integer to string, number, currency or percentage
from number to string, integer, currency or percentage
from currency to string, integer or number
from percentage to string, integer or number
from date to string or dateTime
from dateTime to string or date
from
...
Boolean to string, integer or number
...
...
Syntax
from X to string
Code Block |
---|
TEXT(integer, [format], [locale])
TEXT(number, [format], [locale])
TEXT(currency, [format], [locale])
TEXT(percentage, [format], [locale])
TEXT(date, [format])
TEXT(dateTime, [format])
TEXT(boolean, [format]) |
from X to integer
Code Block |
---|
INTEGER(string, [format], [locale])
INTEGER(number)
INTEGER(currency)
INTEGER(percentage)
INTEGER(boolean) |
from X to number
Code Block |
---|
NUMBER(string, [format], [locale])
NUMBER(integer)
NUMBER(currency)
NUMBER(percentage)
NUMBER(boolean) |
from X to currency
Code Block |
---|
CURRENCY(string, [format], [locale])
CURRENCY(integer)
CURRENCY(number) |
from X to percentage
Code Block |
---|
PERCENTAGE(string, [format], [locale])
PERCENTAGE(integer)
PERCENTAGE(number) |
from X to date
Code Block |
---|
DATE(string, [format])
DATE(dateTime) |
from X to datetime
Code Block |
---|
DATETIME(string, [format])
DATETIME(date) |
from X to boolean
Code Block |
---|
BOOLEAN(string, [format]) |
value - The value of the date type that is converted.
format - The format used for conversion. Format must be enclosed by quotes, e.g. “00.00”. locale - 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 all conversion functions that use a string as parameter (e.g., DATETIME(string, [format])), the [format] describes the format in which the string parameter is in. By default, these formats are used.
- boolean - true;false
- integer - no default format, the complete string is parsed to integer (leading zeros possible and will be removed)
- number - 4 digits
- percentage - 2 digits
- currency - 2 digits
- date - yyyy-MM-dd
- datetime - yyyy-mm-dd hh:mm:ss
...
Include Page |
---|
| DOC:Conversion function: TEXT |
---|
| DOC:Conversion function: TEXT |
---|
|
Include Page |
---|
| DOC:Conversion function: INTEGER |
---|
| DOC:Conversion function: INTEGER |
---|
|
Include Page |
---|
| DOC:Conversion function: NUMBER |
---|
| DOC:Conversion function: NUMBER |
---|
|
Include Page |
---|
| DOC:Conversion function: CURRENCY |
---|
| DOC:Conversion function: CURRENCY |
---|
|
Include Page |
---|
| DOC:Conversion function: PERCENTAGE |
---|
| DOC:Conversion function: PERCENTAGE |
---|
|
Include Page |
---|
| DOC:Conversion function: DATE |
---|
| DOC:Conversion function: DATE |
---|
|
Include Page |
---|
| DOC:Conversion function: DATETIME |
---|
| DOC:Conversion function: DATETIME |
---|
|
Include Page |
---|
| DOC:Conversion function: BOOLEAN |
---|
| DOC:Conversion function: BOOLEAN |
---|
|
- 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
Date Patterns
...
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.
INTEGER(“1,0”, ”#0.0”, “nl-NL”) results in an integer value 1
NUMBER(TRUE) results in a number value 1.0000
CURRENCY(“1.2”, “invalidPattern”) results in a currency value 1.20 (an unknown pattern will be ignored)
DATETIME(“19861221 12:02:56”, “yyyyMMdd HH:mm:ss") results in a dateTime value 1986-12-21T12:02:56
BOOLEAN(“1”,”1;0”) results in a boolean value TRUE
...
Please see the Reference Guide: Language Formats to change how the runtime displays attributes.