Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

format when turning float into string

# Option one
older_method_string = "%.9f" % numvar
# Option two, preferred in Python 3
newer_method_string = "{:.9f}".format(numvar)
# Option 3 (versions 3.6 and higher)
newest_method_string = f"{numvar:.9f}"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #format #turning #float #string
ADD COMMENT
Topic
Name
4+1 =