Analysis updated 2026-07-14 · repo last pushed 2021-07-20
Display file sizes in a file manager app as human-readable values like 4.2 GiB.
Show network traffic on a dashboard as 12 megabits per second instead of raw numbers.
Parse user input like 7.05 GiB from a config file back into the underlying byte count.
Format measurements on embedded devices that lack a standard library.
| ogham/rust-number-prefix | tonbo-io/ursula | aftertonesignal/brume | |
|---|---|---|---|
| Stars | 25 | 25 | 24 |
| Language | Rust | Rust | Rust |
| Last pushed | 2021-07-20 | — | — |
| Maintenance | Dormant | — | — |
| Setup difficulty | easy | hard | hard |
| Complexity | 2/5 | 5/5 | 5/5 |
| Audience | developer | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
Add the crate to your Cargo.toml and call the formatting or parsing functions directly.
The rust-number-prefix library helps developers format numbers with familiar prefixes like "kilo," "mega," or "giga." Instead of showing a user a raw number like 8,542 bytes, the library converts it into a more readable format like "8.5 kB." It takes large or unwieldy numbers and turns them into the kind of clean, human-friendly values you'd expect to see in a file explorer or a data dashboard. At its core, the library works by repeatedly dividing a number until it lands in a readable range, then attaching the correct prefix. You can choose between decimal prefixes (which divide by 1,000) or binary prefixes (which divide by 1,024 and are commonly used for digital storage). If a number is too small to need a prefix, the library simply returns the original value. It also handles the reverse: it can parse strings like "7.05 GiB" back into the underlying number and prefix, making it useful for reading user input or configuration values. Developers building applications that display file sizes, network speeds, or other large measurements would reach for this. For example, someone writing a file manager might use it to show that a video takes up "4.2 GiB" rather than listing 4,509,715,660 bytes. Similarly, a data dashboard could use it to present network traffic as "12 megabits per second" instead of a long raw figure. It can output either the abbreviated symbols (like "kB") or the full word (like "kilobytes"), giving developers flexibility in how they present information. One notable detail is that the library supports environments without the Rust standard library (no_std), meaning it can run on very constrained systems like embedded devices. It also recognizes that small numbers often need different handling than large ones, a file that's 705 bytes should display as "705 bytes," not "0.7 kB", so it lets developers special-case those values.
A Rust library that formats large numbers with readable prefixes like kilo, mega, or giga, turning raw values like 8542 bytes into clean outputs like 8.5 kB. It also parses prefixed strings back into numbers.
Mainly Rust. The stack also includes Rust, no_std.
Dormant — no commits in 2+ years (last push 2021-07-20).
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.