Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

format string to 2 decimal places python

num = 123.4567
print(round(num, 2))
#2 is the number of decimal digits (after the .)
 
PREVIOUS NEXT
Tagged: #format #string #decimal #places #python
ADD COMMENT
Topic
Name
4+2 =