We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 328a5a1 commit 5a1c421Copy full SHA for 5a1c421
source/c03/p03_format_numbers_for_output.rst
@@ -24,15 +24,15 @@
24
25
>>> # Right justified in 10 chars, one-digit accuracy
26
>>> format(x, '>10.1f')
27
- ' 1234.6'
+ ' 1234.6'
28
29
>>> # Left justified
30
>>> format(x, '<10.1f')
31
- '1234.6 '
+ '1234.6 '
32
33
>>> # Centered
34
>>> format(x, '^10.1f')
35
- ' 1234.6 '
+ ' 1234.6 '
36
37
>>> # Inclusion of thousands separator
38
>>> format(x, ',')
@@ -98,9 +98,9 @@
98
>>> '%0.2f' % x
99
'1234.57'
100
>>> '%10.1f' % x
101
102
>>> '%-10.1f' % x
103
104
>>>
105
106
这种格式化方法也是可行的,不过比更加先进的 ``format()`` 要差一点。
0 commit comments