DEV Community

Discussion on: Daily Challenge #49 - Dollars and Cents

Collapse
 
rafaacioly profile image
Rafael Acioly

Python :)

def to_currency(value: float) -> str:
    return "${:.2f}".format(value)

print(to_currency(6.2)) # $6.20