Merge pull request #188 from velour/stock

fixed loss of decimal point in stock prices
This commit is contained in:
Scott Kiesel 2019-06-13 10:35:19 -04:00 committed by GitHub
commit 887fbe8824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -69,10 +69,10 @@ func (p *StockPlugin) message(c bot.Connector, kind bot.Kind, message msg.Messag
response := "Failed to retrieve data for stock symbol: " + tokens[1]
cleaned := strings.ReplaceAll(string(body), " ", "")
regex := regexp.MustCompile("[0-9][0-9]\\. ")
cleaned = regex.ReplaceAllString(cleaned, "")
cleaned := regex.ReplaceAllString(string(body), "")
cleaned = strings.ReplaceAll(cleaned, " ", "")
var info GlobalQuote
err = json.Unmarshal([]byte(cleaned), &info)