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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # humfmt
//!
//! Ergonomic human-readable formatting toolkit for Rust.
//!
//! `humfmt` provides lightweight, fluent utilities for rendering machine values
//! into readable strings designed for humans.
//!
//! ## Quick examples
//!
//! ```rust
//! use humfmt::Humanize;
//!
//! assert_eq!(humfmt::bytes(1536).to_string(), "1.5KB");
//! assert_eq!(humfmt::number(15320).to_string(), "15.3K");
//! assert_eq!(1_500_000.human_number().to_string(), "1.5M");
//! assert_eq!(humfmt::ordinal(21).to_string(), "21st");
//! assert_eq!(humfmt::duration(core::time::Duration::from_secs(3661)).to_string(), "1h 1m");
//! assert_eq!(humfmt::ago(core::time::Duration::from_secs(90)).to_string(), "1m 30s ago");
//! assert_eq!(humfmt::list(&["red", "green", "blue"]).to_string(), "red, green, and blue");
//!
//! #[cfg(feature = "russian")]
//! assert_eq!(
//! humfmt::duration_with(
//! core::time::Duration::from_secs(3665),
//! humfmt::DurationOptions::new()
//! .locale(humfmt::locale::Russian)
//! .long_units()
//! .max_units(3),
//! )
//! .to_string(),
//! "1 час 1 минута 5 секунд"
//! );
//! ```
//!
//! ## Builder customization
//!
//! ```rust
//! use humfmt::{Humanize, NumberOptions};
//!
//! let out = 15_320.human_number_with(
//! NumberOptions::new()
//! .precision(2)
//! .long_units()
//! );
//!
//! assert_eq!(out.to_string(), "15.32 thousand");
//! ```
//!
//! ## Current modules
//!
//! - byte-size formatting
//! - compact number formatting
//! - ordinal formatting
//! - duration formatting
//! - relative time formatting
//! - natural-language list formatting
//! - configurable precision
//! - locale-aware numbers, ordinals, durations, and relative time
//! - optional Russian and Polish locale packs
//! - custom locale builder
//! - optional chrono/time integration
//!
//! More humanizers are planned.
extern crate alloc;
pub use ;
pub use ;
pub use ;
pub use NegativeDurationError;
pub use ;
pub use ;
pub use ;
pub use Humanize;