Skip to content

util.inspect: fix numericSeparator for scientific notation numbers#62987

Open
AmSach wants to merge 1 commit intonodejs:mainfrom
AmSach:fix/inspect-sci-not-numeric-sep
Open

util.inspect: fix numericSeparator for scientific notation numbers#62987
AmSach wants to merge 1 commit intonodejs:mainfrom
AmSach:fix/inspect-sci-not-numeric-sep

Conversation

@AmSach
Copy link
Copy Markdown

@AmSach AmSach commented Apr 27, 2026

Fixes #62981

When numericSeparator: true is set, util.inspect produces corrupted output like '1e-.1e-_7' for numbers in scientific notation (e.g. 1e-7).

The fix adds an early return for scientific notation strings before the decimal-split + numeric separator logic runs.

When numericSeparator: true is set, util.inspect produces corrupted
output like '1e-.1e-_7' for numbers in scientific notation (e.g. 1e-7).

The fix adds an early return for scientific notation strings before
the decimal-split + numeric separator logic runs.

Fixes nodejs#62981
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

util.inspect: incorrect numericSeparator formatting for numbers in scientific notation (e.g. 1e-7)

2 participants