MCPcopy Create free account
hub / github.com/francoispqt/gojay / encodeFloat

Method encodeFloat

encode_number_float.go:19–22  ·  view source on GitHub ↗

encodeFloat encodes a float64 to JSON

(n float64)

Source from the content-addressed store, hash-verified

17
18// encodeFloat encodes a float64 to JSON
19func (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
25func (enc *Encoder) EncodeFloat32(n float32) error {

Callers 3

EncodeSQLNullFloat64Method · 0.95
EncodeFloatMethod · 0.95
marshalFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected