MCPcopy
hub / github.com/shopspring/decimal / RequireFromString

Function RequireFromString

decimal.go:281–287  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

279// d := RequireFromString("-123.45")
280// d2 := RequireFromString(".0001")
281func 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//

Calls 1

NewFromStringFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…