diff --git a/README.md b/README.md index b8208d8..5ac2a5f 100644 --- a/README.md +++ b/README.md @@ -401,40 +401,40 @@ Format ### General Options ```python -{:<10} # ' ' -{:^10} # ' ' -{:>10} # ' ' +{:<10} # ' ' +{:^10} # ' ' +{:>10} # ' ' ``` ```python -{:.<10} # '......' -{:>0} # '' +{:.<10} # '......' +{:>0} # '' ``` ### Strings **`'!r'` calls object's repr() method, instead of str(), to get a string.** ```python -{'abcde'!r:<10} # "'abcde' " -{'abcde':.3} # 'abc' -{'abcde':10.3} # 'abc ' +{'abcde'!r:<10} # "'abcde' " +{'abcde':.3} # 'abc' +{'abcde':10.3} # 'abc ' ``` ### Numbers ```python -{ 123456:10,} # ' 123,456' -{ 123456:10_} # ' 123_456' -{ 123456:+10} # ' +123456' -{-123456:=10} # '- 123456' -{ 123456: } # ' 123456' -{-123456: } # '-123456' +{ 123456:10,} # ' 123,456' +{ 123456:10_} # ' 123_456' +{ 123456:+10} # ' +123456' +{-123456:=10} # '- 123456' +{ 123456: } # ' 123456' +{-123456: } # '-123456' ``` ### Floats ```python -{1.23456:10.3} # ' 1.23' -{1.23456:10.3f} # ' 1.235' -{1.23456:10.3e} # ' 1.235e+00' -{1.23456:10.3%} # ' 123.456%' +{1.23456:10.3} # ' 1.23' +{1.23456:10.3f} # ' 1.235' +{1.23456:10.3e} # ' 1.235e+00' +{1.23456:10.3%} # ' 123.456%' ``` #### Comparison of float presentation types: @@ -469,9 +469,9 @@ Format ### Ints ```python -{90:c} # 'Z' -{90:X} # '5A' -{90:b} # '1011010' +{90:c} # 'Z' +{90:X} # '5A' +{90:b} # '1011010' ``` diff --git a/index.html b/index.html index a876c1a..cf92422 100644 --- a/index.html +++ b/index.html @@ -496,32 +496,32 @@ to_exclusive = <range>.stop '187' -

General Options

{<el>:<10}       # '<el>      '
-{<el>:^10}       # '   <el>   '
-{<el>:>10}       # '      <el>'
+

General Options

{<el>:<10}           # '<el>      '
+{<el>:^10}           # '   <el>   '
+{<el>:>10}           # '      <el>'
 
-
{<el>:.<10}      # '<el>......'
-{<el>:>0}        # '<el>'
+
{<el>:.<10}          # '<el>......'
+{<el>:>0}            # '<el>'
 
-

Strings

'!r' calls object's repr() method, instead of str(), to get a string.

{'abcde'!r:<10}  # "'abcde'   "
-{'abcde':.3}     # 'abc'
-{'abcde':10.3}   # 'abc       '
+

Strings

'!r' calls object's repr() method, instead of str(), to get a string.

{'abcde'!r:<10}      # "'abcde'   "
+{'abcde':.3}         # 'abc'
+{'abcde':10.3}       # 'abc       '
 
-

Numbers

{ 123456:10,}    # '   123,456'
-{ 123456:10_}    # '   123_456'
-{ 123456:+10}    # '   +123456'
-{-123456:=10}    # '-   123456'
-{ 123456: }      # ' 123456'
-{-123456: }      # '-123456'
+

Numbers

{ 123456:10,}        # '   123,456'
+{ 123456:10_}        # '   123_456'
+{ 123456:+10}        # '   +123456'
+{-123456:=10}        # '-   123456'
+{ 123456: }          # ' 123456'
+{-123456: }          # '-123456'
 
-

Floats

{1.23456:10.3}   # '      1.23'
-{1.23456:10.3f}  # '     1.235'
-{1.23456:10.3e}  # ' 1.235e+00'
-{1.23456:10.3%}  # '  123.456%'
+

Floats

{1.23456:10.3}       # '      1.23'
+{1.23456:10.3f}      # '     1.235'
+{1.23456:10.3e}      # ' 1.235e+00'
+{1.23456:10.3%}      # '  123.456%'
 

Comparison of float presentation types:

+----------------+----------------+---------------+----------------+-----------------+
@@ -551,9 +551,9 @@ to_exclusive   = <range>.stop
 |  567.89        |   '5.7e+02'    |    '567.89'   |   '5.68e+02'   |   '56789.00%'   |
 +----------------+----------------+---------------+----------------+-----------------+
 
-

Ints

{90:c}           # 'Z'
-{90:X}           # '5A'
-{90:b}           # '1011010'
+

Ints

{90:c}               # 'Z'
+{90:X}               # '5A'
+{90:b}               # '1011010'
 

#Numbers

Types

<int>      = int(<float/str/bool>)    # Or: math.floor(<float>)