in conv/float.go [12:30]
func Float64ToBytes(n float64, prec int, buf *[39]byte) []byte {
if n != n {
return NaNb
}
if n == 0 {
if prec > 0 {
if prec < 18 {
return float0[prec]
}
} else {
return float0[0]
}
} else {
if n <= maxEligbleInt64 && n >= minEligbleInt64 && prec < 18 && prec >= 0 {
return f64Dig(n, prec, buf)
}
}
return []byte(strconv.FormatFloat(n, 'f', prec, 64))
}