Taskflows > Taskflow functions > toChar (Numbers)
  

toChar (Numbers)

Converts numeric values to text strings.

Syntax

sff:toChar(xs:double(val))
Note: After you add the function, you must manually add the phrase (xs:double) in the syntax. Otherwise, the taskflow fails.
The following table describes the arguments:
Argument
Required/ Optional
Description
val
Required
The numeric value that you want to convert to a string. You can enter any valid transformation expression.
toChar converts double values to text strings as follows:
toChar converts decimal values to text strings as follows:

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:
sff:toChar(xs:double(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:
sff:toChar(xs:double(SALES))
The following table lists some sample values and return values when the precision is greater than 38:
SALES
RETURN VALUE
2378964536789761
'2378964536789761'
1234567890123456789012345679
'1234567890123456789012345679'
1.234578945469649345876123456
'1.234578945469649345876123456'
0.999999999999999999999999999
'0.999999999999999999999999999'
12345678901234567890123456799
'12345678901234567890123456799'
23456788992233456678458934567123465239
'23456788992233456678458934567123465239'
423456789012345678901234567991234567899
(greater than 38)
'4.23456789012346e+038'
The following table lists some sample values and return values when the precision is greater than 28:
SALES
RETURN VALUE
2378964536789761
'2378964536789761'
1234567890123456789012345679
'1234567890123456789012345679'
1.234578945469649345876123456
'1.234578945469649345876123456'
0.999999999999999999999999999
'0.999999999999999999999999999'
12345678901234567890123456799
(greater than 28)
'1.23456789012346e+028'
The toChar (Dates) function converts a Date/Time datatype to a string with the format you specify. You can convert the entire date or a part of the date to a string.
Note: Use double quotation marks to separate ambiguous format strings, for example D"D""DDD. The empty quotation marks do not appear in the output.