# Żmij
[
](https://github.com/dtolnay/zmij)
[
](https://crates.io/crates/zmij)
[
](https://docs.rs/zmij)
[
](https://github.com/dtolnay/zmij/actions?query=branch%3Amaster)
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][upstream].
[upstream]: https://github.com/vitaut/zmij/tree/378575c13babdc53d8498f2ab1e5ff37f8e28edf
## Example
```rust
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.
[dtoa-benchmark]: https://github.com/dtolnay/dtoa-benchmark

#### License
MIT license.