Re: Formatting a str as a number

Liste des GroupesRevenir à cl python 
Sujet : Re: Formatting a str as a number
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 27. Aug 2024, 22:36:47
Autres entêtes
Organisation : Stefan Ram
Message-ID : <doc-20240827223515@ram.dialup.fu-berlin.de>
References : 1 2 3 4
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?".



Date Sujet#  Auteur
25 Aug 24 * Re: Formatting a str as a number10Stefan Ram
25 Aug 24 `* Re: Formatting a str as a number9Stefan Ram
27 Aug 24  +- Re: Formatting a str as a number1Stefan Ram
27 Aug 24  `* Re: Formatting a str as a number7Grant Edwards
31 Aug 24   +* Re: Formatting a str as a number - Okay, one more related thing...4Stefan Ram
31 Aug 24   i`* Re: Formatting a str as a number - Okay, one more related thing...3Stefan Ram
31 Aug 24   i +- Re: Formatting a str as a number - Okay, one more related thing...1Stefan Ram
1 Sep 24   i `- Re: Formatting a str as a number (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
31 Aug 24   +- Re: Formatting a str as a number - Okay, one more related thing...1MRAB
2 Sep 24   `- Re: Formatting a str as a number - Okay, one more related thing...1dn

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal