CRE Programmer's Guide

Math Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
7-28
Int_to_Decimal
Return Value
The Int_to_Decimal functions return one of the following values:
Considerations
Each function in this group has a secondary entry point. If you invoke the function
using the second entry point, the decimal string returned by the function is terminated
with a single null character. The names of the secondary entry points are the same
names as those given above except that a “c” is appended to the end of the word
“decimal”:
Examples
STRING .EXT s[0:4];
INT err;
err :=
RTL_Int16_to_Decimal_( 1234, s, 5, RTL^Leading^separate );
! S = "+1234";
err :=
RTL_Int16_to_Decimal_( -1234, s, 4, RTL^Trailing^embedded );
! S = %h313233B4;
Return Value Meaning
0 The operation was successful.
1 The size of the destination was not large enough to hold the value.
Significant digits were truncated.
2 len was invalid. len must be greater than zero and less than or equal to
19.
3 You specified an unsigned DECIMAL result, but the source was a negative
number. You need to specify a signed result.
4 You specified an invalid sign-type.
Name as Shown Above Name of Secondary Entry Point
RTL_Int16_to_Decimal_ RTL_Int16_to_Decimalc_
RTL_Int32_to_Decimal_ RTL_Int32_to_Decimalc_
RTL_Int64_to_Decimal_ RTL_Int64_to_Decimalc_