Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

add a dot in a long number in python

num = 10000 // Your number
str_num = str(num)
output = ''
count = 1
for i in str_num[::-1]:
    if count % 3 == 0:
        output = output + i + '.'
        count = 0
    else:
        output = output + i
    count += 1
return output[::-1]
Comment

PREVIOUS NEXT
Code Example
Python :: python check if variable is string 
Python :: pandas series to list 
Python :: python search for string in file 
Python :: divide a value by all values in a list 
Python :: python env variable 
Python :: replacing values in pandas dataframe 
Python :: factorise expression python 
Python :: zermelo api 
Python :: making hexagon in python turtle 
Python :: python open website 
Python :: flip specific bit python 
Python :: Make solutions faster in python 
Python :: send email hotmail using python 
Python :: empty dataframe 
Python :: python read file in string list 
Python :: for loop with float python 
Python :: how to launch jupyter notebook from cmd 
Python :: how to print not equal to in python 
Python :: how to add subplots for histogram in pandas 
Python :: py exe tkinter 
Python :: clear pygame screen 
Python :: how to graph with python 
Python :: list of characters python 
Python :: how to create a custom callback function in keras while training the model 
Python :: notify2 python example 
Python :: how to add and subtract days datetime python 
Python :: sort json python 
Python :: How to make an simple python client 
Python :: how to do swapping in python without sort function 
Python :: count number of words in a string python 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =