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 : 25. Aug 2024, 17:46:25
Autres entêtes
Organisation : Stefan Ram
Message-ID : <combination-20240825164553@ram.dialup.fu-berlin.de>
References : 1 2
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,}"

  .



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