Commit 1ae18f5
committed
gh-130664: support '_' (just as ',') in Decimal's formatting
```pycon
>>> from _decimal import Decimal as D
>>> format(D(1234567), '_')
'1_234_567'
>>> format(D(1234567), '020_')
'0_000_000_001_234_567'
>>> format(D('1234.56'), '07_')
'1_234.56'
>>> format(D('1.23456789'), '_')
'1.23456789'
>>> format(D('123.456789'), '_%')
'12_345.6789%'
>>> from _pydecimal import Decimal as D
>>> format(D(1234567), '_')
'1_234_567'
>>> format(D(1234567), '020_')
'0_000_000_001_234_567'
>>> format(D('1234.56'), '07_')
'1_234.56'
>>> format(D('1.23456789'), '_')
'1.23456789'
>>> format(D('123.456789'), '_%')
'12_345.6789%'
```1 parent 0dba59e commit 1ae18f5
File tree
3 files changed
+8
-1
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6098 | 6098 | | |
6099 | 6099 | | |
6100 | 6100 | | |
6101 | | - | |
| 6101 | + | |
6102 | 6102 | | |
6103 | 6103 | | |
6104 | 6104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1085 | 1090 | | |
1086 | 1091 | | |
1087 | 1092 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments