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

Method Float32

encode_number_float.go:252–258  ·  view source on GitHub ↗

Float32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key)

(v float32)

Source from the content-addressed store, hash-verified

250
251// Float32 adds a float32 to be encoded, must be used inside a slice or array encoding (does not encode a key)
252func (enc *Encoder) Float32(v float32) {
253 r := enc.getPreviousRune()
254 if r != '[' {
255 enc.writeByte(',')
256 }
257 enc.buf = strconv.AppendFloat(enc.buf, float64(v), 'f', -1, 32)
258}
259
260// Float32OmitEmpty adds an int to be encoded and skips it if its value is 0,
261// must be used inside a slice or array encoding (does not encode a key).

Callers 1

AddFloat32Method · 0.95

Calls 2

getPreviousRuneMethod · 0.95
writeByteMethod · 0.95

Tested by

no test coverage detected