From 3077d5fe7772066bd5a72c913966d0e8616c86d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Mon, 26 Sep 2022 23:52:14 +0800 Subject: [PATCH] - update --- big_output.go | 6 ++++++ version.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/big_output.go b/big_output.go index 7b1a7a8..9a0ecc4 100644 --- a/big_output.go +++ b/big_output.go @@ -12,6 +12,12 @@ func (d Decimal) String() string { return d.floatValue.String() } +// Int64 输出 int64 +func (d Decimal) Int64() int64 { + i64, _ := d.floatValue.Int64() + return i64 +} + // Float64 输出 float64 func (d Decimal) Float64() float64 { rat, _ := new(big.Rat).SetString(d.String()) diff --git a/version.go b/version.go index f46c0b0..7cb8d41 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package godecimal -const Version = "1.0.8" +const Version = "1.0.9"