pmnumberstr(3) — Linux manual page

NAME | C SYNOPSIS | DESCRIPTION | NOTES | SEE ALSO | COLOPHON

PMNUMBERSTR(3)           Library Functions Manual          PMNUMBERSTR(3)

NAME         top

       pmNumberStr, pmNumberStr_r - fixed width output format for numbers

C SYNOPSIS         top

       #include <pcp/pmapi.h>

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

       cc ... -lpcp

DESCRIPTION         top

       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 thou‐
       sand'' (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):
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚            value range            β”‚ format  β”‚
                β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                β”‚         > 999995000000000         β”‚  inf?   β”‚
                β”‚ 999995000000000 - 999995000000    β”‚ ddd.ddT β”‚
                β”‚    999995000000 - 999995000       β”‚ ddd.ddG β”‚
                β”‚       999995000 - 999995          β”‚ ddd.ddM β”‚
                β”‚          999995 - 999.995         β”‚ ddd.ddK β”‚
                β”‚         999.995 - 0.005           β”‚ ddd.dd  β”‚
                β”‚           0.005 - -0.005          β”‚   0.00  β”‚
                β”‚          -0.005 - -99.95          β”‚ -dd.dd  β”‚
                β”‚         -99.995 - -99995          β”‚ -dd.ddK β”‚
                β”‚          -99995 - -99995000       β”‚ -dd.ddM β”‚
                β”‚       -99995000 - -99995000000    β”‚ -dd.ddG β”‚
                β”‚    -99995000000 - -99995000000000 β”‚ -dd.ddT β”‚
                β”‚        < -99995000000000          β”‚ -inf?   β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

       At  the  boundary points of the ranges, the chosen format will re‐
       tain the maximum number of significant digits.

NOTES         top

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

SEE ALSO         top

       printf(3)

COLOPHON         top

       This  page is part of the PCP (Performance Co-Pilot) project.  In‐
       formation about the project can be found at  ⟨http://www.pcp.io/⟩.
       If  you  have  a  bug  report  for  this  manual  page, send it to
       pcp@groups.io.  This page was obtained from the project's upstream
       Git repository ⟨https://github.com/performancecopilot/pcp.git⟩  on
       2026-05-24.   (At  that  time,  the date of the most recent commit
       that was found in the repository was 2026-05-24.)  If you discover
       any rendering problems in this HTML version of the  page,  or  you
       believe  there is a better or more up-to-date source for the page,
       or you have corrections or improvements to the information in this
       COLOPHON (which is not part of the original manual page),  send  a
       mail to man-pages@man7.org

Performance Co-Pilot               PCP                     PMNUMBERSTR(3)