// FormatFloat64ToAnyStringFunnel is used for funnels.
550357
func FormatFloat64ToAnyStringFunnel(v float64, pattern string) string {
	return fmt.Sprintf(pattern, ChangeToFunnelPct(v))
}
665107
func (ctx *Context) ParamFloat64(key string, defaults ...float64) float64 {
	return ctx.Params().MustFloat64(key, defaults...)
}
848896
func F(n float64, v uint64) (f int64) {

	s := strconv.FormatFloat(n-float64(int64(n)), 'f', int(v), 64)

	// with either be '0' or '0.xxxx', so if 1 then f will be zero
	// otherwise need to parse
	if len(s) != 1 {

		// ignoring error, because it can't fail as we generated
		// the string internally from a real number
		f, _ = strconv.ParseInt(s[2:], 10, 64)
	}

	return
}
348638
func (f *formatter) formatString(b []byte, s string) {
	if len(s) > len(b) {
		f.err = ErrFieldTooLong
		return
	}
	ascii := toASCII(s)
	copy(b, ascii)
	if len(ascii) < len(b) {
		b[len(ascii)] = 0
	}
}
582914
func defaultFormatter(val float64, precision int) string {
	return strconv.FormatFloat(val, 'f', precision, 64)
}
275419
func ParseFloat64(valueString string) (float64, error) {
	if valueString == "" {
		return 0.0, nil
	}
	valueString = strings.Replace(valueString, ",", "", -1)
	return strconv.ParseFloat(valueString, 64)
}
282115
func FlattenFn(fieldName string, field reflect.Value, values *url.Values) {
	l := field.Len()
	if l > 0 {
		for i := 0; i < l; i++ {
			str := field.Index(i).String()
			values.Set(fieldName+"."+strconv.Itoa(i+1), str)
		}
	}
}
1094391
func (l *Logger) GaugeFloat(title string, value float64) {
	l.GaugeFloatD(title, value, M{})
}
617895
func (s *StreamEncoder) AddFloat64(value float64) {
	s.buf = strconv.AppendFloat(s.buf, value, 'f', -1, 64)
	s.Encoder.writeByte(s.delimiter)
}
1244059
func resultErrorFormatNumber(n float64) string {

	if isFloat64AnInteger(n) {
		return fmt.Sprintf("%d", int64(n))
	}

	return fmt.Sprintf("%g", n)
}
534524
func tryToFloat64(v reflect.Value) (float64, error) {
	if v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface {
		v = v.Elem()
	}
	switch v.Kind() {
	case reflect.Float64, reflect.Float32:
		return v.Float(), nil
	case reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8, reflect.Int:
		return float64(v.Int()), nil
	case reflect.Bool:
		if v.Bool() {
			return 1, nil
		}
		return 0, nil
	case reflect.String:
		f, err := strconv.ParseFloat(v.String(), 64)
		if err == nil {
			return f, nil
		}
	}
	return 0.0, errors.New("couldn't convert to a float64")
}
1054727
func (email *Email) SetFormatFunc(fn FormatFunc) {
	email.rw.Lock()
	defer email.rw.Unlock()

	email.formatFunc = fn
}
1230038
func (t *Tabulate) SetFloatFormat(format byte) *Tabulate {
	t.FloatFormat = format
	return t
}
1034996
func Float32ToString(from float32) (string, error) {
	return strconv.FormatFloat(float64(from), 'E', -1, 32), nil
}
1340895
func formatFloat(f float64, maxPrec int) string {
	v := strconv.FormatFloat(f, 'f', -1, 64)

	idx := strings.LastIndex(v, ".")
	if idx == -1 {
		return v
	}

	sublen := idx + maxPrec + 1
	if sublen > len(v) {
		sublen = len(v)
	}

	return v[:sublen]
}
981706
func ToFloat64(val interface{}) (float64, error) {
	switch v := val.(type) {
	case int:
		return float64(v), nil
	case int8:
		return float64(v), nil
	case int16:
		return float64(v), nil
	case int32:
		return float64(v), nil
	case int64:
		return float64(v), nil
	case float32:
		return float64(v), nil
	case float64:
		return v, nil
	case string:
		return strconv.ParseFloat(v, 64)
	case json.Number:
		return v.Float64()
	default:
		return 0, fmt.Errorf("Unhandled type: %t", v)
	}
}
1336403
func StringToInt64Slice(s, sep string) []int64 {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int64, len(fields))
	for i, f := range fields {
		slice[i] = ToInt64(f)
	}
	return slice
}