Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to make a beautiful currency display in python?

I have the code:

money = 3467898542

print(money)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I want the value to be output with dots, example: 3.467.898.542
How do I do this?

I searched the internet, but I didn’t find anything. Please help me or give me a link to the answer if there is one

>Solution :

Try:

money = 3467898542
print(f"{money:_}".replace("_", "."))

Prints:

3.467.898.542
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading