mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-23 04:40:49 +01:00
Compare commits
1 commit
3b53264ada
...
a19d52c58f
Author | SHA1 | Date | |
---|---|---|---|
|
a19d52c58f |
4 changed files with 6 additions and 4 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go: [ '1.10.x', '1.19', '1.20', '1.21', '1.22', '1.x' ]
|
go: [ '1.7.x', '1.18', '1.19', '1.20', '1.21', '1.x' ]
|
||||||
name: Go ${{ matrix.go }}
|
name: Go ${{ matrix.go }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
|
@ -22,7 +22,7 @@ Run `go get github.com/shopspring/decimal`
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Decimal library requires Go version `>=1.10`
|
Decimal library requires Go version `>=1.7`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
|
@ -1414,7 +1414,9 @@ 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)
|
scaledD := d.rescale(0)
|
||||||
return scaledD.value
|
i := &big.Int{}
|
||||||
|
i.SetString(scaledD.String(), 10)
|
||||||
|
return i
|
||||||
}
|
}
|
||||||
|
|
||||||
// BigFloat returns decimal as BigFloat.
|
// BigFloat returns decimal as BigFloat.
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
||||||
module github.com/shopspring/decimal
|
module github.com/shopspring/decimal
|
||||||
|
|
||||||
go 1.10
|
go 1.7
|
||||||
|
|
Loading…
Reference in a new issue