René's URL Explorer Experiment


Title: util: fix numericSeparator with negative fractional numbers by Han5991 · Pull Request #59379 · nodejs/node · GitHub

Open Graph Title: util: fix numericSeparator with negative fractional numbers by Han5991 · Pull Request #59379 · nodejs/node

X Title: util: fix numericSeparator with negative fractional numbers by Han5991 · Pull Request #59379 · nodejs/node

Description: util: fix numericSeparator for negative fractional numbers Fixes a bug in util.inspect() where negative fractional numbers between -1 and 0 were incorrectly formatted when using the numericSeparator option. Changes Fix formatNumber function: Use original string representation to preserve negative sign for fractional numbers Update test expectations: Correct scientific notation test to not expect numeric separators Before util.inspect([-0.12, -0.123], { numericSeparator: true }) // Output: '[ 0..12, 0..12_3 ]' ❌ After util.inspect([-0.12, -0.123], { numericSeparator: true }) // Output: '[ -0.12, -0.123 ]' ✅ Root Cause The issue was in the formatNumber function where String(Math.trunc(-0.12)) returns "0" instead of "-0", losing the negative sign. The fix uses the original string representation and properly slices integer and fractional parts while preserving the sign. Testing ✅ Existing regression test now passes ✅ All util.inspect tests pass ✅ No breaking changes to existing functionality Closes #59376

Open Graph Description: util: fix numericSeparator for negative fractional numbers Fixes a bug in util.inspect() where negative fractional numbers between -1 and 0 were incorrectly formatted when using the numericSeparato...

X Description: util: fix numericSeparator for negative fractional numbers Fixes a bug in util.inspect() where negative fractional numbers between -1 and 0 were incorrectly formatted when using the numericSeparato...

Opengraph URL: https://github.com/nodejs/node/pull/59379

X: @github

direct link

Domain: redirect.github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4c9ec30c-c1ae-9751-a648-8f68874a3c4e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDE72:28F93A:9F2744C:D8449B7:6A4BD3D4
html-safe-nonce33f488bf426afae00d040b7d6bef71d6551045dcabf928f4589713b858505d23
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTcyOjI4RjkzQTo5RjI3NDRDOkQ4NDQ5Qjc6NkE0QkQzRDQiLCJ2aXNpdG9yX2lkIjoiNjk2OTk3NDkzOTUwMDQwMTYyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3b52541abf5617131634e7ba464f163080956f137d8db26d80276d632f4a04bf
hovercard-subject-tagpull_request:2724778292
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/59379/files
twitter:imagehttps://avatars.githubusercontent.com/u/73056306?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/73056306?s=400&v=4
og:image:altutil: fix numericSeparator for negative fractional numbers Fixes a bug in util.inspect() where negative fractional numbers between -1 and 0 were incorrectly formatted when using the numericSeparato...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9df996be9551ac02247d09a2f7f64ece66c35ca28885d346e98fdfda9cdaa37b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb71208a1c9ec7ccf364087569d0551f665dda674
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/nodejs/node/pull/59379/files#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F59379%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F59379%2Ffiles
Sign up https://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://redirect.github.com/nodejs/node/pull/59379/files
Reloadhttps://redirect.github.com/nodejs/node/pull/59379/files
Reloadhttps://redirect.github.com/nodejs/node/pull/59379/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59379/files
nodejs https://redirect.github.com/nodejs
nodehttps://redirect.github.com/nodejs/node
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59379/files
Notifications https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Code https://redirect.github.com/nodejs/node
Issues 1.4k https://redirect.github.com/nodejs/node/issues
Pull requests 966 https://redirect.github.com/nodejs/node/pulls
Actions https://redirect.github.com/nodejs/node/actions
Projects https://redirect.github.com/nodejs/node/projects
Security and quality 0 https://redirect.github.com/nodejs/node/security
Insights https://redirect.github.com/nodejs/node/pulse
Code https://redirect.github.com/nodejs/node
Issues https://redirect.github.com/nodejs/node/issues
Pull requests https://redirect.github.com/nodejs/node/pulls
Actions https://redirect.github.com/nodejs/node/actions
Projects https://redirect.github.com/nodejs/node/projects
Security and quality https://redirect.github.com/nodejs/node/security
Insights https://redirect.github.com/nodejs/node/pulse
Sign up for GitHub https://redirect.github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://redirect.github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
nodejs-github-bothttps://redirect.github.com/nodejs-github-bot
nodejs:mainhttps://redirect.github.com/nodejs/node/tree/main
Han5991:fix/util-inspect-negative-fractionalhttps://redirect.github.com/Han5991/node/tree/fix/util-inspect-negative-fractional
Conversation 13 https://redirect.github.com/nodejs/node/pull/59379
Commits 3 https://redirect.github.com/nodejs/node/pull/59379/commits
Checks 44 https://redirect.github.com/nodejs/node/pull/59379/checks
Files changed 2 https://redirect.github.com/nodejs/node/pull/59379/files
util: fix numericSeparator with negative fractional numbers https://redirect.github.com/nodejs/node/pull/59379/files#top
Show all changes 3 commits https://redirect.github.com/nodejs/node/pull/59379/files
dff58fd util: fix numericSeparator with negative fractional numbers Han5991 Aug 6, 2025 https://redirect.github.com/nodejs/node/pull/59379/commits/dff58fd7f5648ae8e3f3a686fe4c5322f660baa2
97b7fcb util: clarify unreachable decimalIndex === -1 branch Han5991 Aug 7, 2025 https://redirect.github.com/nodejs/node/pull/59379/commits/97b7fcbca8c9eb960f15ac1b72b17952e91e9ebd
11ccf3f util: remove unreachable code in formatNumber Han5991 Sep 4, 2025 https://redirect.github.com/nodejs/node/pull/59379/commits/11ccf3fe10a6b75eed994f12f710426545710732
Clear filters https://redirect.github.com/nodejs/node/pull/59379/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59379/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59379/files
inspect.js https://redirect.github.com/nodejs/node/pull/59379/files#diff-ee826b416a72014ac81621cf3ecaeec6adcc40163f60775d157aa94618c80201
test-util-inspect.js https://redirect.github.com/nodejs/node/pull/59379/files#diff-755e2936fb30a27966acf7a34f5e4f73478d2a19a6bed3372586a7421b43d4b1
lib/internal/util/inspect.jshttps://redirect.github.com/nodejs/node/pull/59379/files#diff-ee826b416a72014ac81621cf3ecaeec6adcc40163f60775d157aa94618c80201
View file https://redirect.github.com/Han5991/node/blob/11ccf3fe10a6b75eed994f12f710426545710732/lib/internal/util/inspect.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/nodejs/node/pull/59379/{{ revealButtonHref }}
https://redirect.github.com/nodejs/node/pull/59379/files#diff-ee826b416a72014ac81621cf3ecaeec6adcc40163f60775d157aa94618c80201
https://redirect.github.com/nodejs/node/pull/59379/files#diff-ee826b416a72014ac81621cf3ecaeec6adcc40163f60775d157aa94618c80201
test/parallel/test-util-inspect.jshttps://redirect.github.com/nodejs/node/pull/59379/files#diff-755e2936fb30a27966acf7a34f5e4f73478d2a19a6bed3372586a7421b43d4b1
View file https://redirect.github.com/Han5991/node/blob/11ccf3fe10a6b75eed994f12f710426545710732/test/parallel/test-util-inspect.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/nodejs/node/pull/59379/{{ revealButtonHref }}
https://redirect.github.com/nodejs/node/pull/59379/files#diff-755e2936fb30a27966acf7a34f5e4f73478d2a19a6bed3372586a7421b43d4b1
https://redirect.github.com/nodejs/node/pull/59379/files#diff-755e2936fb30a27966acf7a34f5e4f73478d2a19a6bed3372586a7421b43d4b1
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59379/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.