MCPcopy Create free account
hub / github.com/cockroachdb/apd / NewFromString

Method NewFromString

decimal.go:187–190  ·  view source on GitHub ↗

NewFromString creates a new decimal from s. The returned Decimal has its exponents restricted by the context and its value rounded if it contains more digits than the context's precision.

(s string)

Source from the content-addressed store, hash-verified

185// exponents restricted by the context and its value rounded if it contains more
186// digits than the context's precision.
187func (c *Context) NewFromString(s string) (*Decimal, Condition, error) {
188 d := new(Decimal)
189 return c.SetString(d, s)
190}
191
192// SetString sets d to s and returns d. The returned Decimal has its exponents
193// restricted by the context and its value rounded if it contains more digits

Callers 5

gdaTestFunction · 0.80
ExampleContext_QuantizeFunction · 0.80
newDecimalFunction · 0.80
NewFromStringFunction · 0.80

Calls 1

SetStringMethod · 0.95

Tested by 4

gdaTestFunction · 0.64
ExampleContext_QuantizeFunction · 0.64
newDecimalFunction · 0.64