Merge pull request #2251 from freqtrade/telegram_fiatconvert
Telegram fiatconvert with identical currencies
This commit is contained in:
commit
f987e6e0f9
@ -104,7 +104,7 @@ class CryptoToFiatConverter(object):
|
||||
:return: float, value in fiat of the crypto-currency amount
|
||||
"""
|
||||
if crypto_symbol == fiat_symbol:
|
||||
return crypto_amount
|
||||
return float(crypto_amount)
|
||||
price = self.get_price(crypto_symbol=crypto_symbol, fiat_symbol=fiat_symbol)
|
||||
return float(crypto_amount) * float(price)
|
||||
|
||||
|
@ -210,3 +210,10 @@ def test_convert_amount(mocker):
|
||||
fiat_symbol="BTC"
|
||||
)
|
||||
assert result == 1.23
|
||||
|
||||
result = fiat_convert.convert_amount(
|
||||
crypto_amount="1.23",
|
||||
crypto_symbol="BTC",
|
||||
fiat_symbol="BTC"
|
||||
)
|
||||
assert result == 1.23
|
||||
|
Loading…
Reference in New Issue
Block a user