Fast floating point to string conversion
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Tolnay 965cd3aed2
Some checks failed
ci.yml / Sync to vitaut/zmij@88292bd (push) Failing after 0s
Sync to vitaut/zmij@88292bd
2026-03-01 23:51:55 -08:00
.github/workflows Unpin CI miri toolchain 2026-02-15 19:10:03 -08:00
benches Restore support for rustc older than 1.85 2025-12-21 10:02:49 -08:00
fuzz Add fuzz target 2025-12-20 10:09:52 -08:00
src Sync to vitaut/zmij@88292bd 2026-03-01 23:51:55 -08:00
tests Update rand from 0.9 to 0.10 2026-02-08 11:56:33 -08:00
.gitignore zmij 2025-12-17 22:02:22 -08:00
build.rs Use select_unpredictable 2025-12-28 08:13:48 -08:00
Cargo.toml Release 1.0.21 2026-02-11 19:04:35 -08:00
dtoa-benchmark.png Switch to 9975WX benchmark data 2026-01-17 14:03:23 -08:00
LICENSE-MIT Add readme 2025-12-20 09:24:46 -08:00
performance.png Add chart to readme 2025-12-21 09:50:34 -08:00
README.md Sync to vitaut/zmij@88292bd 2026-03-01 23:51:55 -08:00

Żmij

github crates.io docs.rs build status

Pure Rust implementation of Żmij, an algorithm to quickly convert floating point numbers to decimal strings.

This Rust implementation is a line-by-line port of Victor Zverovich's implementation in C++, https://github.com/vitaut/zmij.

Example

fn main() {
    let mut buffer = zmij::Buffer::new();
    let printed = buffer.format(1.234);
    assert_eq!(printed, "1.234");
}

Performance

The dtoa-benchmark compares this library and other Rust floating point formatting implementations across a range of precisions. The vertical axis in this chart shows nanoseconds taken by a single execution of zmij::Buffer::new().format_finite(value) so a lower result indicates a faster library.

performance


License

MIT license.