Skip to content

Commit 0df2a3d

Browse files
committed
Format
1 parent d6b9628 commit 0df2a3d

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,15 @@ Format
347347
{'abcde':10.3} # 'abc '
348348
```
349349

350-
### Number Options
350+
### Float Options
351351
```python
352352
{1.23456:.3f} # '1.235'
353353
{1.23456:10.3f} # ' 1.235'
354+
{1.23456:10.3e} # ' 1.235e+00'
355+
{1.23456:10.3%} # ' 123.456%'
354356
```
355357

358+
### Int Options
356359
```python
357360
{ 123456:10,} # ' 123,456'
358361
{ 123456:10_} # ' 123_456'
@@ -363,22 +366,11 @@ Format
363366
```
364367

365368
```python
366-
{65:c} # 'A'
367-
{3:08b} # '00000011' -> Binary with leading zeros.
368-
{3:0<8b} # '11000000' -> Binary with trailing zeros.
369+
{90:c} # 'Z'
370+
{90:X} # '5A'
371+
{3:08b} # '00000011'
369372
```
370373

371-
#### Float presentation types:
372-
* **`'f'` - Fixed point: `.<precision>f`**
373-
* **`'%'` - Percent: `.<precision>%`**
374-
* **`'e'` - Exponent**
375-
376-
#### Integer presentation types:
377-
* **`'c'` - character**
378-
* **`'b'` - binary**
379-
* **`'x'` - hex**
380-
* **`'X'` - HEX**
381-
382374

383375
Numbers
384376
-------

0 commit comments

Comments
 (0)