File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
14
14
15
15
### Fixed
16
16
17
+ - Decimal package uses a test variable DecimalPrecision instead of a
18
+ package-level variable decimalPrecision (#233 )
19
+
17
20
## [ 1.9.0] - 2022-11-02
18
21
19
22
The release adds support for the latest version of the
@@ -40,7 +43,7 @@ switching.
40
43
- A connection is still opened after ConnectionPool.Close() (#208 )
41
44
- Future.GetTyped() after Future.Get() does not decode response
42
45
correctly (#213 )
43
- - Decimal package use a test function GetNumberLength instead of a
46
+ - Decimal package uses a test function GetNumberLength instead of a
44
47
package-level function getNumberLength (#219 )
45
48
- Datetime location after encode + decode is unequal (#217 )
46
49
- Wrong interval arithmetic with timezones (#221 )
Original file line number Diff line number Diff line change @@ -58,13 +58,13 @@ func NewDecimalFromString(src string) (result *Decimal, err error) {
58
58
// MarshalMsgpack serializes the Decimal into a MessagePack representation.
59
59
func (decNum * Decimal ) MarshalMsgpack () ([]byte , error ) {
60
60
one := decimal .NewFromInt (1 )
61
- maxSupportedDecimal := decimal .New (1 , DecimalPrecision ).Sub (one ) // 10^DecimalPrecision - 1
62
- minSupportedDecimal := maxSupportedDecimal .Neg ().Sub (one ) // -10^DecimalPrecision - 1
61
+ maxSupportedDecimal := decimal .New (1 , decimalPrecision ).Sub (one ) // 10^decimalPrecision - 1
62
+ minSupportedDecimal := maxSupportedDecimal .Neg ().Sub (one ) // -10^decimalPrecision - 1
63
63
if decNum .GreaterThan (maxSupportedDecimal ) {
64
- return nil , fmt .Errorf ("msgpack: decimal number is bigger than maximum supported number (10^%d - 1)" , DecimalPrecision )
64
+ return nil , fmt .Errorf ("msgpack: decimal number is bigger than maximum supported number (10^%d - 1)" , decimalPrecision )
65
65
}
66
66
if decNum .LessThan (minSupportedDecimal ) {
67
- return nil , fmt .Errorf ("msgpack: decimal number is lesser than minimum supported number (-10^%d - 1)" , DecimalPrecision )
67
+ return nil , fmt .Errorf ("msgpack: decimal number is lesser than minimum supported number (-10^%d - 1)" , decimalPrecision )
68
68
}
69
69
70
70
strBuf := decNum .String ()
You can’t perform that action at this time.
0 commit comments