Products
and Services Support
and Docs Training Partner Programs About Red
Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation: man pages: man3: Linux Programmer's Manual (3)

Manpage of ECVT

ECVT

Section: Linux Programmer's Manual (3)
Updated: March 28, 2025
Index  

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

This document was created by using the manual pages.
Time: 11:58:02 GMT, March 24, 2025

 

 


 
© 2001 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat