Repository navigation
A quantity read into a larger declared unit keeps its digits, so 350万元 under 亿元 shows 0.035 instead of 0.04 - #1398
Merged
WaylandYang merged 3 commits intoOct 27, 2026
Conversation
…元 under 亿元 shows 0.035 instead of 0.04 Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
WaylandYang
requested changes
Oct 24, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, the bug is real. Please use maximumSignificantDigits: 15 instead of 20 fraction digits: rules can compute values with arithmetic, and with 20 fraction digits 0.1+0.2 renders as 0.30000000000000004. Fifteen significant digits still shows 0.035 and 0.0003.
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
WaylandYang
approved these changes
Oct 27, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, 15 significant digits shows 0.035 亿元 and 0.3 kg both right. Approving and merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Unit-bearing small quantities were rounded to two decimal places:
0.035 亿元displayed as0.04 亿元, and0.0003 亿元displayed as zero.Changes
Keep two fractional digits for compact notation. Use at most 15 significant digits for ordinary unit-bearing numbers, as requested in review. This preserves small quantities while suppressing floating-point arithmetic noise (
0.1 + 0.2displays as0.3 kg). Add the arithmetic regression to the existing formatter tests.Validation
git diff --checkpasses.Before review
git commit -s)web/:pnpm testpasses; type-check/build pass on the current head