Man page - pmnumberstr_r(3)

Packages contains this manual

Manual

PMNUMBERSTR

NAME
C SYNOPSIS
DESCRIPTION
NOTES
SEE ALSO

NAME

pmNumberStr , pmNumberStr_r - fixed width output format for numbers

C SYNOPSIS

#include <pcp/pmapi.h>

const char *pmNumberStr(double value );
char *pmNumberStr_r(double
value , char * buf , int buflen );

cc ... -lpcp

DESCRIPTION

pmNumberStr returns the address of a 8-byte buffer that holds a null-byte terminated representation of value suitable for output with fixed width fields. The pmNumberStr_r function does the same, but stores the result in a user-supplied buffer buf of length buflen , which should have room for at least 8 bytes.

The value is scaled using multipliers in powers of β€˜β€˜one thousand’’ (the decimal β€˜β€˜kilo’’) and has a bias that provides greater precision for positive numbers as opposed to negative numbers.

The format depends on the sign and magnitude of value as follows (d represents a decimal digit):

Image grohtml-297331-1.png

At the boundary points of the ranges, the chosen format will retain the maximum number of significant digits.

NOTES

pmNumberStr returns a pointer to a static buffer and hence is not thread-safe. Multi-threaded applications should use pmNumberStr_r instead.

SEE ALSO

printf (3)