DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Float decimals
for d in '$50.99', '$50.00', '49.99': print(float(f"{float(d.removeprefix('$')):.2f}"[:-1]))
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Float
#decimals
ADD COMMENT
Topic
COMMENT
Name
3+9 =
Submit