Skip to content

feat: support exponential notation in CalcCraft input and output - #41

Open
pk72 wants to merge 1 commit into
klaudyu:mainfrom
pk72:feature/exponential-notation
Open

feat: support exponential notation in CalcCraft input and output#41
pk72 wants to merge 1 commit into
klaudyu:mainfrom
pk72:feature/exponential-notation

Conversation

@pk72

@pk72 pk72 commented Jun 24, 2026

Copy link
Copy Markdown
  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant