MCPcopy Create free account
hub / github.com/segmentio/encoding / Float

Method Float

json/token.go:280–283  ·  view source on GitHub ↗

Float returns a byte slice containing the value of the json number that the tokenizer is currently pointing at. This method must only be called after checking the kind of the token via a call to Kind. If the tokenizer is not positioned on a number, the behavior is undefined.

()

Source from the content-addressed store, hash-verified

278//
279// If the tokenizer is not positioned on a number, the behavior is undefined.
280func (t *Tokenizer) Float() float64 {
281 f, _ := strconv.ParseFloat(*(*string)(unsafe.Pointer(&t.Value)), 64)
282 return f
283}
284
285// String returns a byte slice containing the value of the json string that the
286// tokenizer is currently pointing at.

Callers 1

encodeFloat64Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected