Fiat price hotfix2 (#94)

* INR added

* also accept currency string

* dividion by 0

* better check
This commit is contained in:
LightningTipBot 2021-10-08 10:53:33 +03:00 committed by GitHub
parent 7c77d268f6
commit 08c7ff5113
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))