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

Method SetString

decimal.go:195–203  ·  view source on GitHub ↗

SetString sets d to s and returns d. The returned Decimal has its exponents restricted by the context and its value rounded if it contains more digits than the context's precision.

(d *Decimal, s string)

Source from the content-addressed store, hash-verified

193// restricted by the context and its value rounded if it contains more digits
194// than the context's precision.
195func (c *Context) SetString(d *Decimal, s string) (*Decimal, Condition, error) {
196 res, err := d.setString(c, s)
197 if err != nil {
198 return nil, 0, err
199 }
200 res |= c.round(d, d)
201 _, err = c.goError(res)
202 return d, res, err
203}
204
205// Set sets d's fields to the values of x and returns d.
206//

Callers 1

NewFromStringMethod · 0.95

Calls 3

roundMethod · 0.95
goErrorMethod · 0.95
setStringMethod · 0.80

Tested by

no test coverage detected