Deutsch   English   Français   Italiano  
<doc-20240827223515@ram.dialup.fu-berlin.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feeds.phibee-telecom.net!news.mixmin.net!news.swapon.de!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: 27 Aug 2024 21:36:47 GMT
Organization: Stefan Ram
Lines: 24
Expires: 1 Jul 2025 11:59:58 GMT
Message-ID: <doc-20240827223515@ram.dialup.fu-berlin.de>
References: <oRHyO.142039$bV6e.134076@fx08.ams4> <asked-20240825164104@ram.dialup.fu-berlin.de> <combination-20240825164553@ram.dialup.fu-berlin.de> <vYqzO.8$fip4.7@fx09.ams4>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de YrYn2l/6mADrw7QqYjXn7Az9S299OJD1vtAzoqdewAphhR
Cancel-Lock: sha1:GG7julEZlAcMiaVyBbyFhXw5JFI= sha256:mbrRlynJY9odK4uv3l9ZODc3TMJrAj+EirzfS3VxZ/o=
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: 2585

Gilmeh Serda <gilmeh.serda@nothing.here.invalid> wrote or quoted:
>On 25 Aug 2024 15:46:25 GMT, Stefan Ram wrote:
>>f"{int(number):>20,}"
>Great. Thanks. Do you have a link to where that's documented?
>I did web search, found nothing.

  Stoked to hear you're into it!

  For docs, I usually snag the PDFs from "python.org," especially
  "reference.pdf" (the Python Language Reference) and "library.pdf"
  (the Python Library Reference), then I search them for keywords.

  The f-string stuff is laid out in "The Python Language Reference"
  since they're part of the language itself. A quick search for
  "f-str" gets you to "2.4.3 Formatted string literals," which says,
  "The result is then formatted using the format() protocol." So, you
  got to check out "The Python Library Reference" too! Searching for
  "format(" there zooms you right to "6.1.3 Format String Syntax"
  (via "Format Specification Mini-Language").

  But honestly, I usually just hit up a chatbot first. I'll drop
  in my code and say, "How can I make this shorter?".