You don't show the code for display_data
, but here's what you need to do:
print "$%0.02f" %amount
This is a format specifier for the variable amount
.
Since this is beginner topic, I won't get into floating point rounding error, but it's good to be aware that it exists.