GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
EXPAND_NUMBER(3) FreeBSD Library Functions Manual EXPAND_NUMBER(3)

expand_number
format a number from human readable form

System Utilities Library (libutil, -lutil)

#include <libutil.h>

int
expand_number(const char *buf, uint64_t *num);

The expand_number() function parses the buf string and stores a unsigned 64-bit quantity at *num.

The expand_number() function is case-insensitive and follows the SI power of two convention.

The suffixes are:

Suffix Description Multiplier
1024
1048576
1073741824
1099511627776
1125899906842624
1152921504606846976

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.

The expand_number() function will fail if:
[]
The given string contains no digits.
[]
An unrecognized suffix was given.
[]
Result doesn't fit into 64 bits.

humanize_number(3)

The expand_number() function first appeared in FreeBSD 6.3.
July 20, 2019 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.