-
Notifications
You must be signed in to change notification settings - Fork 240
fix decimals handling #3297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix decimals handling #3297
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Visit the preview URL for this PR (updated for commit 5252473): https://walletrc--pull-3297-merge-7hhk7a1v.web.app (expires Wed, 05 Nov 2025 14:15:05 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| normalized = normalized | ||
| .replaceAll(' ', '') | ||
| .replaceAll('\u00A0', '') // NBSP | ||
| .replaceAll('\u202F', '') // NNBSP | ||
| .replaceAll("'", '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NBSP separators not stripped during normalization
The new normalizeDecimalString tries to remove non‑breaking spaces (U+00A0) and narrow no‑break spaces (U+202F) before parsing, but the literals passed to replaceAll are '\u00A0' and '\u202F'. Those are two-character sequences (backslash + u…) rather than the actual Unicode whitespace characters, so real NBSPs remain in the string and the subsequent regex fails. Inputs copied from locales that use NBSP as the thousands separator (e.g. French 1 234,56) will still throw FormatException despite the tests claiming support. Use ' ' and ' ' to strip the intended characters.
Useful? React with 👍 / 👎.
add robust normalization utilities