mostly working

This commit is contained in:
Will Charczuk 2019-02-13 18:55:13 -08:00
parent 26eaa1d898
commit 5f42a580a9
47 changed files with 914 additions and 637 deletions

View file

@ -2,6 +2,7 @@ package chart
import (
"strconv"
"strings"
"time"
"github.com/blend/go-sdk/exception"
@ -12,8 +13,13 @@ func ParseFloats(values ...string) ([]float64, error) {
var output []float64
var parsedValue float64
var err error
var cleaned string
for _, value := range values {
if parsedValue, err = strconv.ParseFloat(value, 64); err != nil {
cleaned = strings.TrimSpace(strings.Replace(value, ",", "", -1))
if cleaned == "" {
continue
}
if parsedValue, err = strconv.ParseFloat(cleaned, 64); err != nil {
return nil, exception.New(err)
}
output = append(output, parsedValue)