fix: render subscript zero count in default decimalFold format - #844
Open
NemeZZiZZ wants to merge 1 commit into
Open
fix: render subscript zero count in default decimalFold format#844NemeZZiZZ wants to merge 1 commit into
NemeZZiZZ wants to merge 1 commit into
Conversation
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.
Problem
The default
formatFoldDecimalemits the literal text0{3}instead of a subscript count:Verified by execution:
formatFoldDecimal('0.00051234', 3)→'0.0{3}51234'— braces printed verbatim on axis labels and tooltips for any high-precision symbol (tokens withpricePrecision8–10).The documented sample for this exact feature (
docs/@views/api/samples/init-decimalFold-format/index.js) maps the count to Unicode subscript digits — i.e.0.0₃51234— so the default implementation contradicts the documented behavior of the option it backs.Fix
Port the subscript mapping from the docs sample into
formatFoldDecimal(module-levelsubscriptNumbersmap, zero-count → subscript).One deliberate deviation from the sample: the count is subscripted with
/\d/g(all digits), not/\d/(first only) — the sample renders a two-digit count (10+ leading zeros) as0.0₁2…. With/git is0.0₁₂….Verified outputs:
'0.00051234' → '0.0₃51234','0.000051234' → '0.0₄51234','1.23456'/'0.0051234'/'0.0000'pass through unchanged.