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)
| 193 | // restricted by the context and its value rounded if it contains more digits |
| 194 | // than the context's precision. |
| 195 | func (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 | // |
no test coverage detected