Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python format float as currency

formatted_float = "${:,.2f}".format(1500.2) # Format `1500.2` as currency (note the comma)
print(formatted_float)

# Result: $1,500.20
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #python #format #float #currency
ADD COMMENT
Topic
Name
7+4 =