Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove .0

number = 5.0
number = int(number)
# 5

# Safety net if number is not equal to int
def safe_int(number: float):
	if number - int(number) == 0:
    	return int(number)
 
PREVIOUS NEXT
Tagged: #python #remove
ADD COMMENT
Topic
Name
2+9 =