You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
consider switching to zmij for css numeric serialization #423
I had a quick look into this, and it looks like it might be viable to me. We are currently using the Notation metadata returned by dtoa-short (here) to fixup the output by adding a .0 in cases where dtoa-short doesn't. But it looks to me like zmij may just output our desired formatting without needing the fixup. For example, dtoa-short formats the Rust float literal 1234.0 as 1234 but zmij formats it as 1234.0.
@nicoburns there are some tests in tree but even better would be to run that change on Firefox / Servo's test-suite. If there are no regressions seems good to go.
Looks like the library is ported from another and needs syncing with improvements from the original. That might not be ideal for fixes/security issues.
Activity
nicoburns commentedon Mar 15, 2026
I had a quick look into this, and it looks like it might be viable to me. We are currently using the Notation metadata returned by
dtoa-short(here) to fixup the output by adding a.0in cases where dtoa-short doesn't. But it looks to me likezmijmay just output our desired formatting without needing the fixup. For example,dtoa-shortformats the Rust float literal1234.0as1234butzmijformats it as1234.0.Is there are test suite or spec for this?
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=321ae9b56f96ffefc4403cf2369983ba
emilio commentedon Mar 15, 2026
@nicoburns there are some tests in tree but even better would be to run that change on Firefox / Servo's test-suite. If there are no regressions seems good to go.
SimonSapin commentedon Aug 25, 2026
The standard library now has another candidate https://blog.rust-lang.org/2026/08/20/Rust-1.98.0/#buffered-integer-formatting (or will when we increase MSRV)SimonSapin commentedon Aug 25, 2026
Never mind, the above is about integers but this issue is about floats
tiaanl commentedon Sep 14, 2026
Looks like the library is ported from another and needs syncing with improvements from the original. That might not be ideal for fixes/security issues.