1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pub use NumberDisplay;
pub use NumberOptions;
pub use NumberLike;
use crate;
/// Creates a human-readable compact formatter using default options.
///
/// # Examples
///
/// ```rust
/// assert_eq!(humfmt::number(15320).to_string(), "15.3K");
/// assert_eq!(humfmt::number(1_500_000).to_string(), "1.5M");
/// ```
/// Creates a human-readable compact formatter with custom options.
///
/// # Examples
///
/// ```rust
/// use humfmt::NumberOptions;
///
/// let out = humfmt::number_with(15320, NumberOptions::new().long_units());
/// assert_eq!(out.to_string(), "15.3 thousand");
/// ```