DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+2 =
Submit