mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
Fixes #23098 When numericSeparator: true is set, negative fractional numbers between -1 and 0 (like -0.123) were incorrectly formatted as "0..123" instead of "-0.123". The issue was that Math.trunc(-0.123) returns -0, but String(-0) becomes "0", losing the negative sign. Fixed by checking for -0 with Object.is() and explicitly using "-0" as the string representation. Also fixed scientific notation handling to check the original number string instead of the truncated integer string. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>