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

Function NewFromInt

decimal.go:113–118  ·  view source on GitHub ↗

NewFromInt converts an int64 to Decimal. Example: NewFromInt(123).String() // output: "123" NewFromInt(-10).String() // output: "-10"

(value int64)

Source from the content-addressed store, hash-verified

111// NewFromInt(123).String() // output: "123"
112// NewFromInt(-10).String() // output: "-10"
113func NewFromInt(value int64) Decimal {
114 return Decimal{
115 value: big.NewInt(value),
116 exp: 0,
117 }
118}
119
120// NewFromInt32 converts an int32 to Decimal.
121//

Callers 3

TestNewFromIntFunction · 0.85
TestNewNullDecimalFunction · 0.85
LnMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestNewFromIntFunction · 0.68
TestNewNullDecimalFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…