From a6ce5d41a18f6baedf42e6aa263822204863a99b Mon Sep 17 00:00:00 2001 From: Terry Zhao Date: Sun, 3 Jan 2021 00:12:10 -0500 Subject: [PATCH] fix: unquote commodities & allow "." in ticker --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c31e309..298d01d 100644 --- a/main.go +++ b/main.go @@ -93,6 +93,7 @@ func GetCommodities(ledger string, binary string) []string { commodities := make([]string, 0) for _, e := range sliceOut { + e = strings.Trim(e, `"`) if IsTicker(e) { commodities = append(commodities, e) } @@ -102,7 +103,7 @@ func GetCommodities(ledger string, binary string) []string { func IsTicker(s string) bool { for _, e := range s { - if (e < 'A' || e > 'Z') && (e < '0' || e > '9') { + if (e < 'A' || e > 'Z') && (e < '0' || e > '9') && e != '.' { return false } }