Flashnux

GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)

GNU/Linux

RedHat 5.2

(Apollo)

fcvt(3)


ECVT

ECVT

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

NAME

ecvt, fcvt − convert a floating-point number to a string.

SYNOPSIS

#include <stdlib.h>

char *ecvt(double number, size_t ndigits, int *decpt, int *sign);

char *fcvt(double number, size_t ndigits, int *decpt, int *sign);

DESCRIPTION

The ecvt() function converts number to a NULL terminated string of ndigits digits, and returns a pointer to the string. The string itself does not contain a decimal point; however, the position of the decimal point relative to the start of the string is stored in decpt. A negative value for decpt means that the decimal point is to the left of the start of the string. If the sign of number is negative, sign is set to a non-zero value, otherwise it’s set to 0.

The fcvt() function is identical to ecvt(), except that ndigits specifies the number of digits after the decimal point.

RETURN VALUE

Both the ecvt() and fcvt() functions return a pointer to a static string containing the ASCII representation of number. The static string is overwritten by each call to ecvt() or fcvt().

SEE ALSO

gcvt(3), sprintf(3)



fcvt(3)