Crate humannum

Source
Expand description

Human-friendly number parser

Currently this only currently implements parsing of integers.

The format of values accepted is described in docstring of parse_integer.

§Example (Functional)

use humannum::parse_integer;
let x: u64 = parse_integer("1_320 k").unwrap();
assert_eq!(x, 1320000);

§Example (wrapper)

use humannum::Int;
let x: Int<u32> = "0o1777".parse().unwrap();
assert_eq!(*x, 0o1777)

Structs§

Int
A wrapper for integers that has FromStr implementation

Enums§

Error
Error parsing human-friendly number

Constants§

NUMERIC_SUFFIXES
Numeric suffixes supported by the library

Functions§

parse_integer
Parse integer value from string