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

Function FromFloat64

pkg/util/json/json.go:958–965  ·  view source on GitHub ↗

FromFloat64 returns a JSON value given a float64.

(v float64)

Source from the content-addressed store, hash-verified

956
957// FromFloat64 returns a JSON value given a float64.
958func FromFloat64(v float64) (JSON, error) {
959 dec := apd.Decimal{}
960 _, err := dec.SetFloat64(v)
961 if err != nil {
962 return nil, err
963 }
964 return jsonNumber(dec), nil
965}
966
967// MakeJSON returns a JSON value given a Go-style representation of JSON.
968// * JSON null is Go `nil`,

Callers 2

AsJSONFunction · 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…