feat: support exponential notation in CalcCraft input and output - #41
Open
pk72 wants to merge 1 commit into
Open
feat: support exponential notation in CalcCraft input and output#41pk72 wants to merge 1 commit into
pk72 wants to merge 1 commit into
Conversation
pk72
commented
Jun 24, 2026
- Update regex patterns in src/table-evaluator.ts and src/main.ts to recognize and parse input exponential notation (e.g., 1e9, 2.5e-3) when scanning cell values, unit strings, and math formulas.
- Update formatNumber in src/main.ts to format and output calculated numbers in exponential notation if their absolute value crosses user-defined upper or lower limits.
- Implement settings in src/settings.ts to allow users to configure the exponent thresholds (defaulting to 10^9 and 10^-4) governing when output numbers convert to scientific notation.
- Apply the user's precision configuration to control the number of decimal places displayed in the formatted output numbers.
- Maintain full support for decimal and grouping separators (e.g., commas and periods) when both parsing input and formatting output numbers in exponential notation.
- Update regex patterns in src/table-evaluator.ts and src/main.ts to recognize and parse input exponential notation (e.g., 1e9, 2.5e-3) when scanning cell values, unit strings, and math formulas. - Update formatNumber in src/main.ts to format and output calculated numbers in exponential notation if their absolute value crosses user-defined upper or lower limits. - Implement settings in src/settings.ts to allow users to configure the exponent thresholds (defaulting to 10^9 and 10^-4) governing when output numbers convert to scientific notation. - Apply the user's precision configuration to control the number of decimal places displayed in the formatted output numbers. - Maintain full support for decimal and grouping separators (e.g., commas and periods) when both parsing input and formatting output numbers in exponential notation.
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.