Message341379
And for those who *really* want to be able to apply a format spec to the result of the entire !d expression, you can always use nested f-strings:
>>> for x in [3.1415, 0.5772156649, 100]:
... print(f'{f"{x!d:.1f}":*^20}')
...
*******x=3.1********
*******x=0.6********
******x=100.0*******
Not that I recommend this, but at least it's possible. |
|
Date |
User |
Action |
Args |
2019-05-04 11:52:52 | eric.smith | set | recipients:
+ eric.smith, gregory.p.smith, paul.moore, steven.daprano, dirn, serhiy.storchaka, xtreak |
2019-05-04 11:52:52 | eric.smith | set | messageid: <1556970772.05.0.649953662623.issue36774@roundup.psfhosted.org> |
2019-05-04 11:52:52 | eric.smith | link | issue36774 messages |
2019-05-04 11:52:51 | eric.smith | create | |
|