Repository navigation
fix: prevent scientific notation leak in precision output - #419
Merged
Merged
Conversation
Adds proposal, spec delta, design, and tasks for fixing the precision option leaking scientific notation at the exponent ceiling.
Expand scientific notation for string precision results in applyNumberFormatting so values at the exponent ceiling (e.g. YB/YiB) render as plain decimals instead of '1.00e+6'. Adds regression tests.
Apply oxfmt formatting and rebuild dist bundles.
Archive the OpenSpec change and sync the number-formatting spec.
Owner
Author
Audit ResultsGoal fulfillment: All goals met.
Spec compliance: The new requirement "Precision output never uses scientific notation" is satisfied by the implementation and covered by regression tests. Task completion: All tasks in tasks.md are marked complete. Quality check: No regressions. Full suite passes (284 tests), 100% coverage maintained, lint clean, build succeeds. Existing behavior for locale, separator, padding, negative values, and bigint precision is preserved. Iterations: spec-audit 1, impl-audit 1 (no errors found). |
Merged
9 of 15 tasks
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
Fixes the
precisionoption leaking scientific notation (e+/e-) into output for values at or above the unit ceiling (exponent 8, e.g. YB/YiB).applyNumberFormattingnow expands scientific notation for string precision results, so values like10^30render as1000000 YBinstead of1.00e+6 YB.Type of Change
Related Issues
Closes #418
Testing
tests/unit/filesize.test.jscovering the three reproduction cases.npm testpasses: 284 tests, 100% line/branch/function coverage.npm run buildsucceeds.Checklist
npm testpassesnpm run buildsucceedsScreenshots (if applicable)
N/A