feat: support comma thousand separators in calculator expressions#1052
Merged
feat: support comma thousand separators in calculator expressions#1052
Conversation
Add strip_thousand_separators() function to remove commas between digits so that expressions like '5,032,104/171' are properly evaluated. The original query string with commas is preserved for display. Co-authored-by: medcl <64487+medcl@users.noreply.github.com> Agent-Logs-Url: https://github.com/infinilabs/coco-app/sessions/929459f7-054d-4855-bcf5-b1fd68ce0cd3
Copilot
AI
changed the title
[WIP] Support 5,032,104/171 for calculator app
feat(calculator): support comma thousand separators in number input
Mar 23, 2026
Co-authored-by: medcl <64487+medcl@users.noreply.github.com> Agent-Logs-Url: https://github.com/infinilabs/coco-app/sessions/46a6663e-81ef-4c41-a047-d0e1232cc722
Copilot
AI
changed the title
feat(calculator): support comma thousand separators in number input
Support comma thousand separators in calculator expressions
Mar 23, 2026
luohf-infinilabs
approved these changes
Mar 23, 2026
medcl
approved these changes
Mar 23, 2026
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.
The calculator extension fails to evaluate expressions containing comma-formatted numbers like
5,032,104/171becausemevaldoesn't recognize thousand separators.strip_thousand_separators()that removes commas appearing between digits before passing tomevalfor tokenization and evaluationassert_eq!calls to passrustfmtCI checkUnit tests cover: basic stripping, multiple commas, both operands, edge cases (empty, leading/trailing comma), and end-to-end evaluation through
meval.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.