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

Function FromNumber

pkg/util/json/json.go:887–894  ·  view source on GitHub ↗

FromNumber returns a JSON value given a json.Number.

(v json.Number)

Source from the content-addressed store, hash-verified

885
886// FromNumber returns a JSON value given a json.Number.
887func FromNumber(v json.Number) (JSON, error) {
888 // The JSON decoder has already verified that the string `v` represents a
889 // valid JSON number, and the set of valid JSON numbers is a [proper] subset
890 // of the set of valid apd.Decimal values.
891 dec := apd.Decimal{}
892 _, _, err := dec.SetString(string(v))
893 return jsonNumber(dec), err
894}
895
896// FromString returns a JSON value given a string.
897func FromString(v string) JSON {

Callers 1

MakeJSONFunction · 0.85

Calls 2

jsonNumberTypeAlias · 0.85
SetStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…