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

Function New

decimal.go:100–105  ·  view source on GitHub ↗

New returns a new fixed-point decimal, value * 10 ^ exp.

(value int64, exp int32)

Source from the content-addressed store, hash-verified

98
99// New returns a new fixed-point decimal, value * 10 ^ exp.
100func New(value int64, exp int32) Decimal {
101 return Decimal{
102 value: big.NewInt(value),
103 exp: exp,
104 }
105}
106
107// NewFromInt converts an int64 to Decimal.
108//

Callers 15

Benchmark_FloorFastFunction · 0.85
Benchmark_FloorRegularFunction · 0.85
Benchmark_CmpFunction · 0.85
TestCopyFunction · 0.85
TestDecimal_rescaleFunction · 0.85
TestDecimal_FloorFunction · 0.85
TestDecimal_CeilFunction · 0.85
TestDecimal_MulFunction · 0.85
TestDecimal_DivFunction · 0.85

Calls

no outgoing calls

Tested by 15

Benchmark_FloorFastFunction · 0.68
Benchmark_FloorRegularFunction · 0.68
Benchmark_CmpFunction · 0.68
TestCopyFunction · 0.68
TestDecimal_rescaleFunction · 0.68
TestDecimal_FloorFunction · 0.68
TestDecimal_CeilFunction · 0.68
TestDecimal_MulFunction · 0.68
TestDecimal_DivFunction · 0.68