Commit e476e43
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 <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent f667215 commit e476e43
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 | |
|---|---|---|---|
| |||
1851 | 1851 | | |
1852 | 1852 | | |
1853 | 1853 | | |
| 1854 | + | |
| 1855 | + | |
1854 | 1856 | | |
1855 | | - | |
| 1857 | + | |
1856 | 1858 | | |
1857 | | - | |
1858 | | - | |
| 1859 | + | |
| 1860 | + | |
1859 | 1861 | | |
1860 | | - | |
| 1862 | + | |
1861 | 1863 | | |
1862 | 1864 | | |
1863 | | - | |
| 1865 | + | |
1864 | 1866 | | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1865 | 1872 | | |
1866 | | - | |
| 1873 | + | |
1867 | 1874 | | |
1868 | | - | |
1869 | | - | |
1870 | | - | |
| 1875 | + | |
1871 | 1876 | | |
1872 | 1877 | | |
1873 | 1878 | | |
| |||
| 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