Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python float to string n decimals

float = 2.154327
format_float = "{:.2f}".format(float)	# change .2f to n digits you want
print(format_float)
Source by pythonguides.com #
 
PREVIOUS NEXT
Tagged: #python #float #string #decimals
ADD COMMENT
Topic
Name
3+5 =