Answers for "how to format 1000 to 1k in python"

1

how to format 1000 to 1k in python

Use the Python Numerize Library

For example

from numerize import numerize 
  
n = numerize.numerize(100) # 100
n = numerize.numerize(1000) # 1k
n= numerize.numerize(1500) # 1.5k
n = numerize.numerize(1000000) # 1M 
n = numerize.numerize(1123456) # so on or and so forth
Posted by: Guest on June-07-2021

Code answers related to "how to format 1000 to 1k in python"

Python Answers by Framework

Browse Popular Code Answers by Language