EXPAND_NUMBER
Section: Misc. Reference Manual Pages (3bsd)Index Return to Main Contents
BSD mandoc
NAME
expand_number - format a number from human readable formLIBRARY
Lb libbsdSYNOPSIS
In libutil.h (See libbsd(7) for include usage.) Ft int Fo expand_number Fa const char *buf uint64_t *num FcDESCRIPTION
The Fn expand_number function unformats the Fa buf string and stores a unsigned 64-bit quantity at address pointed out by the Fa num argument.The Fn expand_number function follows the SI power of two convention.
The prefixes are:
- Prefix Ta Description Ta Multiplier
- k Ta kilo Ta 1024
- M Ta mega Ta 1048576
- G Ta giga Ta 1073741824
- T Ta tera Ta 1099511627776
- P Ta peta Ta 1125899906842624
- E Ta exa Ta 1152921504606846976
RETURN VALUES
Rv -stdERRORS
The Fn expand_number function will fail if:- Bq Er EINVAL
- The given string contains no digits.
- Bq Er EINVAL
- An unrecognized prefix was given.
- Bq Er ERANGE
- Result doesn't fit into 64 bits.
SEE ALSO
humanize_number3bsdHISTORY
The Fn expand_number function first appeared in Fx 6.3 .
Index
This document was created by man2html, using the manual pages.
Time: 04:45:39 GMT, September 16, 2022
0 댓글