Sujet : Re: Formatting a str as a number - Okay, one more related thing...
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 31. Aug 2024, 16:26:58
Autres entêtes
Organisation : Stefan Ram
Message-ID : <thousand-20240831162547@ram.dialup.fu-berlin.de>
References : 1 2 3 4 5 6 7 8
Gilmeh Serda <
gilmeh.serda@nothing.here.invalid> wrote or quoted:
Of course I can do f"{123456:>20_}".replace("_", " "), just thought there
might be something else my search mojo fails on.
Looks like this "replace" deal is the go-to move, no two ways
about it. If there's some neck of the woods where it's SOP, you
might wanna roll with "locale.format_string". (Whipping up a custom
locale just for kicks is usually more trouble than it's worth.)