informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

dectoasc()

The dectoasc() function converts a decimal type number to a C char type value.

Syntax

Usage

If right = -1, the decimal value of *np determines the number of decimal places.

If the decimal number does not fit into a character string of length len, dectoasc() converts the number to an exponential notation. If the number still does not fit, dectoasc() fills the string with asterisks. If the number is shorter than the string, dectoasc() left-justifies the number and pads it on the right with blanks.

Because the character string that dectoasc() returns is not null terminated, your program must add a null character to the string before you print it.

Return Codes

0 The conversion was successful.
-1 The conversion failed.

Example

The file dectoasc.ec in the demo directory contains the following sample program.

Output


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved