typed.go
func (t Typed) FloatsIf(key string) ([]float64, bool) {
	value, exists := t[key]
	if exists == false {
		return nil, false
	}
	if n, ok := value.([]float64); ok {
		return n, true
	}
	if a, ok := value.([]interface{}); ok {
		l := len(a)
		n := make([]float64, l)
		for i := 0; i < l; i++ {
			switch t := a[i].(type) {
			case float64:
				n[i] = t
			case string:
				f, err := strconv.ParseFloat(t, 10)
				if err != nil {
					return n, false
				}
				n[i] = f
			default:
				return n, false
			}
		}
		return n, true
	}
	return nil, false
}
func (t Typed) FloatsIf(key string) ([]float64, bool) {
	value, exists := t[key]
	if exists == false {
		return nil, false
	}
	if n, ok := value.([]float64); ok {
		return n, true
	}
	if a, ok := value.([]interface{}); ok {
		l := len(a)
		n := make([]float64, l)
		for i := 0; i < l; i++ {
			switch t := a[i].(type) {
			case float64:
				n[i] = t
			case string:
				f, err := strconv.ParseFloat(t, 10)
				if err != nil {
					return n, false
				}
				n[i] = f
			default:
				return n, false
			}
		}
		return n, true
	}
	return nil, false
}
func ( t Typed ) FloatsIf ( key string ) ( [ ] float64 , bool ) { value , exists := t [ key ] if exists == false { return nil , false } if n , ok := value . ( [ ] float64 ) ; ok { return n , true } if a , ok := value . ( [ ] interface { } ) ; ok { l := len ( a ) n := make ( [ ] float64 , l ) for i := 0 ; i < l ; i ++ { switch t := a [ i ] . ( type ) { case float64 : n [ i ] = t case string : f , err := strconv . ParseFloat ( t , 10 ) if err != nil { return n , false } n [ i ] = f default : return n , false } } return n , true } return nil , false }
// Returns a float slice + true if valid
// Returns nil + false otherwise
// (returns nil+false if one of the values is not a valid float)
Returns a float slice + true if valid Returns nil + false otherwise ( returns nil + false if one of the values is not a valid float )