formatting long numbers as strings in python

后端 未结 9 2479
轻奢々
轻奢々 2020-11-28 07:00

What is an easy way in Python to format integers into strings representing thousands with K, and millions with M, and leaving just couple digits after comma?

I\'d li

9条回答
  •  失恋的感觉
    2020-11-28 07:28

    I had the same need. And if anyone comes on this topic, I found a lib to do so: https://github.com/azaitsev/millify

    Hope it helps :)

提交回复
热议问题