Python Language
Le module local
Recherche…
Remarques
Python 2 Docs: [ https://docs.python.org/2/library/locale.html#locale.currency][1]
Mise en forme des devises US Dollars Utilisation du module local
import locale
locale.setlocale(locale.LC_ALL, '')
Out[2]: 'English_United States.1252'
locale.currency(762559748.49)
Out[3]: '$762559748.49'
locale.currency(762559748.49, grouping=True)
Out[4]: '$762,559,748.49'
Modified text is an extract of the original Stack Overflow Documentation
Sous licence CC BY-SA 3.0
Non affilié à Stack Overflow