zmij_ecma

Crates.iozmij_ecma
lib.rszmij_ecma
version1.0.16
created_at2026-01-03 08:49:06.745677+00
updated_at2026-01-20 15:51:33.919222+00
descriptionA double-to-string conversion algorithm based on Schubfach and yy
homepage
repositoryhttps://github.com/magic-akari/zmij_ecma
max_upload_size
id2019797
size101,570
(magic-akari)

documentation

https://docs.rs/zmij_ecma

README

Żmij ECMA

github crates.io docs.rs build status

Żmij ECMA is a fork of the Żmij crate adjusted to comply with the ECMAScript number-to-string algorithm.


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_ecma::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_ecma::Buffer::new().format_finite(value) so a lower result indicates a faster library.

performance


License

MIT license.

Commit count: 355

cargo fmt