encodeFloat encodes a float64 to JSON
(n float64)
| 17 | |
| 18 | // encodeFloat encodes a float64 to JSON |
| 19 | func (enc *Encoder) encodeFloat(n float64) ([]byte, error) { |
| 20 | enc.buf = strconv.AppendFloat(enc.buf, n, 'f', -1, 64) |
| 21 | return enc.buf, nil |
| 22 | } |
| 23 | |
| 24 | // EncodeFloat32 encodes a float32 to JSON |
| 25 | func (enc *Encoder) EncodeFloat32(n float32) error { |
no outgoing calls
no test coverage detected