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)
| 185 | // exponents restricted by the context and its value rounded if it contains more |
| 186 | // digits than the context's precision. |
| 187 | func (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 |