Commit 670d7ab
authored
util: fix numericSeparator with negative fractional numbers
Fix util.inspect() formatting bug where negative fractional numbers
between -1 and 0 lost their minus sign when numericSeparator was true.
Fixed formatNumber function to preserve sign by using original string
representation. Also corrected test expectations for scientific notation
to not apply numeric separators.
Fixes: #59376
PR-URL: #59379
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>1 parent 26607a6 commit 670d7ab
File tree
2 files changed
+35
-9
lines changed- lib/internal/util
- test/parallel
2 files changed
+35
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| 2106 | + | |
| 2107 | + | |
2106 | 2108 | | |
2107 | | - | |
| 2109 | + | |
2108 | 2110 | | |
2109 | | - | |
2110 | | - | |
| 2111 | + | |
| 2112 | + | |
2111 | 2113 | | |
2112 | | - | |
| 2114 | + | |
2113 | 2115 | | |
2114 | 2116 | | |
2115 | | - | |
| 2117 | + | |
2116 | 2118 | | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
2117 | 2124 | | |
2118 | | - | |
| 2125 | + | |
2119 | 2126 | | |
2120 | | - | |
2121 | | - | |
2122 | | - | |
| 2127 | + | |
2123 | 2128 | | |
2124 | 2129 | | |
2125 | 2130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3493 | 3493 | | |
3494 | 3494 | | |
3495 | 3495 | | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
3496 | 3517 | | |
3497 | 3518 | | |
3498 | 3519 | | |
| |||
0 commit comments