Answers for "format when turning float into string"

0

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}"
Posted by: Guest on May-22-2021

Code answers related to "format when turning float into string"

Python Answers by Framework

Browse Popular Code Answers by Language