RequireFromString returns a new Decimal from a string representation or panics if NewFromString had returned an error. Example: d := RequireFromString("-123.45") d2 := RequireFromString(".0001")
(value string)
| 279 | // d := RequireFromString("-123.45") |
| 280 | // d2 := RequireFromString(".0001") |
| 281 | func RequireFromString(value string) Decimal { |
| 282 | dec, err := NewFromString(value) |
| 283 | if err != nil { |
| 284 | panic(err) |
| 285 | } |
| 286 | return dec |
| 287 | } |
| 288 | |
| 289 | // NewFromFloat converts a float64 to Decimal. |
| 290 | // |
searching dependent graphs…