code: def format_price(price, currency='$'):
      
      if int(price) == price:
          return '{}{}'.format(currency, int(price))
      return '{}{:0.2f}'.format(currency, price)
docs: Format the price to have the appropriate currency and digits..
  
      :param price: The price amount.
      :param currency: The currency for the price.
      :return: A formatted price string, i.e. '$10', '$10.52'.