table of contents
expand_number(3bsd) | 3bsd | expand_number(3bsd) |
NAME¶
expand_number
—
format a number from human readable form
LIBRARY¶
library “libbsd”
SYNOPSIS¶
#include
<libutil.h>
(See libbsd(7)
for include usage.)
int
expand_number
(const char *buf,
uint64_t *num);
DESCRIPTION¶
The
expand_number
()
function unformats the buf string and stores a
unsigned 64-bit quantity at address pointed out by the
num argument.
The
expand_number
()
function follows the SI power of two convention.
The prefixes are:
Prefix | Description | Multiplier |
k |
kilo | 1024 |
M |
mega | 1048576 |
G |
giga | 1073741824 |
T |
tera | 1099511627776 |
P |
peta | 1125899906842624 |
E |
exa | 1152921504606846976 |
RETURN VALUES¶
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
ERRORS¶
The expand_number
() function will fail
if:
SEE ALSO¶
HISTORY¶
The expand_number
() function first
appeared in FreeBSD 6.3.
August 15, 2010 | Linux 6.4.0-150600.23.25-default |