Compare commits

...

2 commits

Author SHA1 Message Date
Dean Eigenmann
aadc2cec61
Merge 584bc5502b into 57a340d853 2024-01-24 20:44:48 -07:00
Dean Eigenmann
584bc5502b
optimize conversion 2023-09-25 17:23:17 +02:00

View file

@ -1088,10 +1088,7 @@ func (d Decimal) IntPart() int64 {
// BigInt returns integer component of the decimal as a BigInt. // BigInt returns integer component of the decimal as a BigInt.
func (d Decimal) BigInt() *big.Int { func (d Decimal) BigInt() *big.Int {
scaledD := d.rescale(0) return new(big.Int).Set(d.value)
i := &big.Int{}
i.SetString(scaledD.String(), 10)
return i
} }
// BigFloat returns decimal as BigFloat. // BigFloat returns decimal as BigFloat.