MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / FromFloat64

Function FromFloat64

pkg/util/json/json.go:1953–1960  ·  view source on GitHub ↗

FromFloat64 returns a JSON value given a float64.

(v float64)

Source from the content-addressed store, hash-verified

1951
1952// FromFloat64 returns a JSON value given a float64.
1953func FromFloat64(v float64) (JSON, error) {
1954 dec := apd.Decimal{}
1955 _, err := dec.SetFloat64(v)
1956 if err != nil {
1957 return nil, err
1958 }
1959 return jsonNumber(dec), nil
1960}
1961
1962// MakeJSON returns a JSON value given a Go-style representation of JSON.
1963// * JSON null is Go `nil`,

Callers 3

AsJSONFunction · 0.92
ParseMethod · 0.92
MakeJSONFunction · 0.70

Calls 1

jsonNumberTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…