humfmt
Ergonomic human-readable formatting toolkit for Rust
humfmt is a lightweight Rust library for turning raw machine values into human-friendly text.
Designed to provide:
- compact number rendering (
15320 -> 15.3K) - fluent builder-style customization
- locale-ready suffix formatting
- ergonomic extension trait API
no_std-friendly usage withalloc- zero-macro, zero-nonsense usage
The crate aims to be tiny, intuitive, and pleasant enough that formatting stops feeling like work.
✨ Quick Example
use Humanize;
⚙️ Customized Formatting
use ;
✅ Current Features
- Compact number formatter
- Builder-style
NumberOptions -
Humanizeextension trait - Long and short suffix units
- Locale abstraction foundation
- Doctests and integration tests
🗺️ Planned Roadmap
Upcoming humanizers planned for future releases:
-
bytes()— human-readable byte sizes -
duration()— compact duration formatting -
ago()— relative time rendering -
ordinal()— 1st / 2nd / 3rd style helpers - additional locale packs
- zero-allocation optimization pass
📦 Installation
Add dependency:
[]
= "0.1"
For no_std targets with alloc available:
[]
= { = "0.1", = false }
Feature Flags
std(default): enables the standard-library build.default-features = false: builds the current formatter onno_std+alloc.englishstays in the default set for forward-compatible locale gating in0.1.x.alloc,russian, andpolishare reserved compatibility flags in0.1.x; they do not change runtime behavior yet.chronoandtimekeep their optional dependencies wired and CI-checked, but no public integration API is exposed yet.
🧪 Development Status
humfmt is under active early-stage development.
The current public surface is intentionally small and focused on compact number formatting first.
Expect rapid iteration, formatter additions, and locale improvements.
📚 Documentation
- examples available in
/examples - integration tests available in
/tests - rustdoc examples available on all public number APIs
- published crate: https://crates.io/crates/humfmt
- API docs: https://docs.rs/humfmt
📄 License
Licensed under MIT.
⭐ Philosophy
This crate follows one simple rule:
Human formatting should feel stupidly easy.
No giant config structs. No formatting gymnastics. No "why is this so annoying?" moments.
Just:
println!;
and move on with your life.