The result of each embedded expression is formatted using Python's "formatting specification". So, the formatting rules are the same as what you might be used to with the `format`

function.

#### Examples

##### Fill with leading zeros

```
>>> number = 2
>>> f'My number is: {number:02}.'
'The number is: 02.'
```

Filling with anything other than zero requires an alignment flag (`>`

or `<`

).

```
>>> status = 5
>>> f'{status:x<3}'
'5xx'
```

##### Rounding decimals

```
>>> total = decimal.Decimal('10.123456')
>>> f'The total value is: {value:.4}.'
'The total value is: 10.12.'
```

##### Separating thousands with commas

```
>>> population = 12500345
>>> print(f'The population is: {population:,}.')
'The population is: 12,500,345.'
```

##### Printing datetimes

```
>>> today = datetime.datetime(year=2019, month=11, day=5)
>>> f'{today:%B %d, %Y}'
' November 05, 2019'
```

These are just a few examples of special formatting rules. See the formatting specification docs for more details.