MentOS  0.8.0
The Mentoring Operating System
Functions
fcvt.h File Reference

Declare the functions required to turn double values into a string. More...

Go to the source code of this file.

Functions

void ecvtbuf (double arg, int chars, int *decpt, int *sign, char *buf, unsigned buf_size)
 Thif function transforms value into a string of digits inside buf, representing the whole part followed by the decimal part. More...
 
void fcvtbuf (double arg, int decimals, int *decpt, int *sign, char *buf, unsigned buf_size)
 Thif function transforms value into a string of digits inside buf, representing the whole part followed by the decimal part. More...
 

Detailed Description

Declare the functions required to turn double values into a string.

Function Documentation

◆ ecvtbuf()

void ecvtbuf ( double  arg,
int  chars,
int *  decpt,
int *  sign,
char *  buf,
unsigned  buf_size 
)

Thif function transforms value into a string of digits inside buf, representing the whole part followed by the decimal part.

For instance, 512.765 will result in: decpt = 3 sign = 0 buf = "512765"

Parameters
argThe argument to turn into string.
charsThe total number of digits.
decptThe position of the decimal point.
signThe sign of the number.
bufBuffer where the digits should be placed.
buf_sizeDimension of the buffer.

◆ fcvtbuf()

void fcvtbuf ( double  arg,
int  decimals,
int *  decpt,
int *  sign,
char *  buf,
unsigned  buf_size 
)

Thif function transforms value into a string of digits inside buf, representing the whole part followed by the decimal part.

For instance, 512.765 will result in: decpt = 3 sign = 0 buf = "512765"

Parameters
argThe argument to turn into string.
decimalsThe total number of digits to write after the decimal point.
decptThe position of the decimal point.
signThe sign of the number.
bufBuffer where the digits should be placed.
buf_sizeDimension of the buffer.