func toFloat64(v interface{}) (float64, error) {
	if str, ok := v.(string); ok {
		iv, err := strconv.ParseFloat(str, 64)
		if err != nil {
			return 0, errors.Errorf("cannot convert %v to float64", v)
		}
		return iv, nil
	}

	val := reflect.Indirect(reflect.ValueOf(v))
	switch val.Kind() {
	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
		return float64(val.Int()), nil
	case reflect.Uint8, reflect.Uint16, reflect.Uint32:
		return float64(val.Uint()), nil
	case reflect.Uint, reflect.Uint64:
		return float64(val.Uint()), nil
	case reflect.Float32, reflect.Float64:
		return val.Float(), nil
	case reflect.Bool:
		if val.Bool() == true {
			return 1, nil
		}
		return 0, nil
	default:
		return 0, errors.Errorf("cannot convert %v to float64", v)
	}
}
// toFloat64 converts 64-bit floats
toFloat64 converts 64-bit floats
// toFloat64 converts 64 - bit floats
func toFloat64(v interface{}) (float64, error) {
	if str, ok := v.(string); ok {
		iv, err := strconv.ParseFloat(str, 64)
		if err != nil {
			return 0, errors.Errorf("cannot convert %v to float64", v)
		}
		return iv, nil
	}
	val := reflect.Indirect(reflect.ValueOf(v))
	switch val.Kind() {
	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
		return float64(val.Int()), nil
	case reflect.Uint8, reflect.Uint16, reflect.Uint32:
		return float64(val.Uint()), nil
	case reflect.Uint, reflect.Uint64:
		return float64(val.Uint()), nil
	case reflect.Float32, reflect.Float64:
		return val.Float(), nil
	case reflect.Bool:
		if val.Bool() == true {
			return 1, nil
		}
		return 0, nil
	default:
		return 0, errors.Errorf("cannot convert %v to float64", v)
	}
}
func toFloat64 ( v interface { } ) ( float64 , error ) { if str , ok := v . ( string ) ; ok { iv , err := strconv . ParseFloat ( str , 64 ) if err != nil { return 0 , errors . Errorf ( " " , v ) } return iv , nil } val := reflect . Indirect ( reflect . ValueOf ( v ) ) switch val . Kind ( ) { case reflect . Int8 , reflect . Int16 , reflect . Int32 , reflect . Int64 , reflect . Int : return float64 ( val . Int ( ) ) , nil case reflect . Uint8 , reflect . Uint16 , reflect . Uint32 : return float64 ( val . Uint ( ) ) , nil case reflect . Uint , reflect . Uint64 : return float64 ( val . Uint ( ) ) , nil case reflect . Float32 , reflect . Float64 : return val . Float ( ) , nil case reflect . Bool : if val . Bool ( ) == true { return 1 , nil } return 0 , nil default : return 0 , errors . Errorf ( " " , v ) } }
toFloat64 converts 64-bit floats
toFloat64 converts 64 - bit floats