Convert X bit coins to valid currency amount

def convert_btc_to_cur(self, coins, currency):
        """
        Convert X bit coins to valid currency amount
        """
        if isinstance(coins, Decimal):
            use_decimal = True
        else:
            use_decimal = self._force_decimal

        url = 'https://api.coindesk.com/v1/bpi/currentprice/{}.json'.format(currency)
        response = requests.get(url)
        if response.status_code == 200:
            data = response.json()
            price = data.get('bpi').get(currency, {}).get('rate_float', None)
            if price:
                if use_decimal:
                    price = Decimal(price)
                try:
                    converted_amount = coins * price
                    return converted_amount
                except TypeError:
                    raise DecimalFloatMismatchError("convert_btc_to_cur requires coins parameter is of type Decimal when force_decimal=True")
        raise RatesNotAvailableError("BitCoin Rates Source Not Ready For Given date")