# Python dumping leading zeros

**URL:** <https://discuss.python.org/t/python-dumping-leading-zeros/13828>\
**Category:** Python Help\
**Tags:** help\
**Created:** [February 21, 2022, 4:42am UTC](https://discuss.python.org/t/python-dumping-leading-zeros/13828 "2022-02-21T04:42:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![hauntsaninja](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hauntsaninja/32/12451_2.png) [@hauntsaninja](https://discuss.python.org/u/hauntsaninja)\
**Post date:** [February 21, 2022, 6:22am UTC](https://discuss.python.org/t/python-dumping-leading-zeros/13828/3 "2022-02-21T06:22:33Z")

</div>

How you format a number (leading zeros, scientific notation, significant figures) isn’t intrinsic to the number itself, but something you specify when converting the number to a string.

```auto
num = 1
assert f"{num:04}" == "0001"

```

---

_[View the full topic](https://discuss.python.org/t/python-dumping-leading-zeros/13828)._
