Skip to content

[change] Trim zeros after round and make pad independent#69

Merged
Mc-Zen merged 1 commit intomainfrom
trim-rounding
Mar 9, 2026
Merged

[change] Trim zeros after round and make pad independent#69
Mc-Zen merged 1 commit intomainfrom
trim-rounding

Conversation

@Mc-Zen
Copy link
Owner

@Mc-Zen Mc-Zen commented Mar 9, 2026

Trailing zeros are now stripped after rounding. Padding is then applied, even if the number was rounded (in order to maybe recover zeros).

This results in one effective change:

Before: num(round: (precision: 2, pad: false)[0.299] -> $0.30$

Now: num(round: (precision: 2, pad: false)[0.299] -> $0.3$

Fixes the issue

At first it now feels to me like the rounding step should do 0.2999 -> 0.3 instead of 0.2999 -> 0.300 so that the result 0.300 should only happen through padding afterwards.

from #66 (comment).

@Mc-Zen Mc-Zen merged commit 66c2d3b into main Mar 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant