mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Use locale.format_string() for more than one specifier.
This commit is contained in:
parent
04fd324fe3
commit
fb69631af7
1 changed files with 2 additions and 2 deletions
|
@ -61,8 +61,8 @@ formatting numbers with group separators::
|
|||
>>> x = 1234567.8
|
||||
>>> locale.format("%d", x, grouping=True)
|
||||
'1,234,567'
|
||||
>>> locale.format("%s%.*f", (conv['currency_symbol'],
|
||||
... conv['frac_digits'], x), grouping=True)
|
||||
>>> locale.format_string("%s%.*f", (conv['currency_symbol'],
|
||||
... conv['frac_digits'], x), grouping=True)
|
||||
'$1,234,567.80'
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue