From 08c7ff51130cea344f855c7e7785d72bbbdc1274 Mon Sep 17 00:00:00 2001 From: LightningTipBot <88730856+LightningTipBot@users.noreply.github.com> Date: Fri, 8 Oct 2021 10:53:33 +0300 Subject: [PATCH] Fiat price hotfix2 (#94) * INR added * also accept currency string * dividion by 0 * better check --- internal/telegram/amounts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/telegram/amounts.go b/internal/telegram/amounts.go index 0db7fea..e30728e 100644 --- a/internal/telegram/amounts.go +++ b/internal/telegram/amounts.go @@ -51,7 +51,7 @@ func getAmount(input string) (amount int, err error) { log.Errorln(err) return 0, err } - if price.Price[currency] == 0 { + if !(price.Price[currency] > 0) { return 0, errors.New("price is zero") } amount = int(fmount / price.Price[currency] * float64(100_000_000))