Formatting Currencies Using Python

I would like to format integers as professional currency strings. For instance:

1200000 → $ 1.2 million.
456 → $ 456.00

Do you know a good library for this, ideally, with localization to handle European formats.

+3
source share
2 answers

Such formatting seems reasonable for some limited purposes. But, should 1,200,000 be formatted as 1.2 million or 1.20 million? And aren't 456 friendlier, like 456 dollars (without cents)?

( , $12,000,000.00).

, , . .

+1

Source: https://habr.com/ru/post/1731975/


All Articles