| Deutsch English Français Italiano |
|
<combination-20240825164553@ram.dialup.fu-berlin.de> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Formatting a str as a number
Date: 25 Aug 2024 15:46:25 GMT
Organization: Stefan Ram
Lines: 11
Expires: 1 Jul 2025 11:59:58 GMT
Message-ID: <combination-20240825164553@ram.dialup.fu-berlin.de>
References: <oRHyO.142039$bV6e.134076@fx08.ams4> <asked-20240825164104@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 9KIg4zNYaxpdPlxKduUlswON7miPQp7qtjQeP1nMdEyEpT
Cancel-Lock: sha1:/pmSqhYWkEdPTX9B0cUQU26Q/TQ= sha256:4u+nohlodLCrD3k6P+rjh9FbqEWleOpAHUYNVqWyD9E=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Bytes: 1657
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
>| >>> format_number("123456789")
>| ' 123,456,789'
Yeah, you totally can combine the two format specifications into one:
f"{int(number):>20,}"
.