Header Ads Widget

[MAN] expand_number

Content-type: text/html; charset=UTF-8 Man page of EXPAND_NUMBER

EXPAND_NUMBER

Section: Misc. Reference Manual Pages (3bsd)
Index Return to Main Contents

BSD mandoc
 

NAME

expand_number - format a number from human readable form  

LIBRARY

Lb libbsd  

SYNOPSIS

In libutil.h (See libbsd(7) for include usage.) Ft int Fo expand_number Fa const char *buf uint64_t *num Fc  

DESCRIPTION

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 -std  

ERRORS

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_number3bsd  

HISTORY

The Fn expand_number function first appeared in Fx 6.3 .


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
SEE ALSO
HISTORY

This document was created by man2html, using the manual pages.
Time: 04:45:39 GMT, September 16, 2022

댓글 쓰기

0 댓글