Support fixed-decimal arguments and canonical numeric selection - #31
Merged
waywardmonkeys merged 3 commits intoSep 18, 2026
Merged
Conversation
added 3 commits
September 17, 2026 13:53
Allow owned and borrowed fixed_decimal::Decimal values to enter the facade and runtime argument maps without an f64 conversion. This preserves precision, sign, and trailing-zero scale for formatting, resolved text, and plural operands.
Use one canonical plain-decimal key for numeric exact selection so equivalent source spellings cannot all match the same payload. Keep the comparison allocation-free while preserving decimal scale for formatting, textual selection, and plural operands.
Treat an unannotated resolved decimal like other numeric operands after :offset. This prevents keyword projection from retrying :offset without its required adjustment and lets adjusted decimals select the expected plural category.
Georgiy-Tugai
force-pushed
the
feat/fixed-decimal-args
branch
from
September 17, 2026 12:10
8f5614a to
2cc0142
Compare
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.
Summary
fixed_decimal::Decimalvalues as message arguments.1,1.0, and1e0all select the canonical key11.0and1e0do not match1.2300selects the canonical key1.230:stringselection scale-sensitive.:integer,:offset, and:percentpayloads independently of display options.Why
Converting decimal arguments through floating point loses precision and scale information. Mathematical equality for exact selector keys also allowed multiple equivalent spellings to match the same value, making selection dependent on source ordering.
This change retains the original decimal representation where formatting and plural semantics require it, while giving numeric exact selection one deterministic MF2-compatible serialization.