Transformation Language Reference > Functions > TO_CHAR (Numbers)
  

TO_CHAR (Numbers)

Converts numeric values to text strings. TO_CHAR also converts dates to strings.
TO_CHAR converts double values to text strings as follows:
TO_CHAR converts decimal values to text strings as follows:

Syntax

TO_CHAR( numeric_value )
The following table describes the argument for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric data type. The numeric value you want to convert to a string. You can enter any valid transformation expression.

Return Value

String.
NULL if a value passed to the function is NULL.

Double Conversion Example

The following expression converts the double values in the SALES port to strings:
TO_CHAR( SALES )
SALES
RETURN VALUE
1010.99
'1010.99'
-15.62567
'-15.62567'
10842764968208837340
'1.08427649682088e+019'  (rounded based on the 16th digit and returns the value in scientific notation)
236789034569723
'236789034569723'
0
'0'
33.15
'33.15'
NULL
NULL

Decimal Conversion Example

The following expression converts the decimal values in the SALES port to strings in high precision mode:
TO_CHAR( SALES )
SALES
RETURN VALUE
2378964536789761
'2378964536789761'
1234567890123456789012345679
'1234567890123456789012345679'
1.234578945469649345876123456
'1.234578945469649345876123456'
0.999999999999999999999999999
'0.999999999999999999999999999'
12345678901234567890123456799
(greater than 28)
'1.23456789012346e+028'