Decimal implements fmt.Formatter. %#v prints Go code that recreates the value, like decimal.New(314, -2), instead of the struct fields, and verbs that don't apply, like %d, print %!d(decimal.Decimal=3.14). %v, %s, %q, %x and fmt.Println print the same as before #463
Ln rounds correctly, so some results change in the last digit: Ln of 10 to 5 places is 2.30259, not 2.30258#471
ExpHullAbrham returns overallPrecision significant figures for every input. Negative inputs used to lose digits or return 0, like -50 at precision 10, and large inputs returned extra digits #429#470
Scan converts float32 with NewFromFloat32, so 54.33 stays 54.33 instead of becoming 54.33000183105469. NaN and infinite floats return an error instead of panicking #469
On Go 1.10 to 1.12, NewFromFloat can pick a different shortest form in rare cases (golang/go#29491). It still converts back to the same float #431
FEATURES
Add BSON Decimal128 support for Decimal and NullDecimal with the official MongoDB Go driver v2, without a new dependency #460
Add %f formatting with precision, width and flags, like %.2f and %08.2f#463
Add Normalize, which strips trailing zeros so equal decimals also match with reflect.DeepEqual, testify and gomock #464
NewFromString accepts the Unicode minus sign − (U+2212) #428
Scanning NULL into a Decimal returns an error that points to NullDecimal or *Decimal#474
Document that global settings aren't goroutine-safe, and list them with their per-call alternatives in the README #466
README: show how to control the JSON format of one field, add udecimal to the alternative libraries, and update the Go doc and playground links #475#476#264
Fix doc examples that were wrong or didn't compile #468
Fix benchmarks that measured their setup or the wrong function #467
BUGFIXES
QuoRem and DivRound panic on precision math.MinInt32 instead of returning a wrong quotient #472
Configuration
📅Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/shopspring/decimal](https://github.com/shopspring/decimal) | `v1.5.0` → `v1.6.0` |  |  |
---
### Release Notes
<details>
<summary>shopspring/decimal (github.com/shopspring/decimal)</summary>
### [`v1.6.0`](https://github.com/shopspring/decimal/blob/HEAD/CHANGELOG.md#Decimal-v160)
[Compare Source](https://github.com/shopspring/decimal/compare/v1.5.0...v1.6.0)
##### BEHAVIOR CHANGES
- `Decimal` implements `fmt.Formatter`. `%#v` prints Go code that recreates the value, like `decimal.New(314, -2)`, instead of the struct fields, and verbs that don't apply, like `%d`, print `%!d(decimal.Decimal=3.14)`. `%v`, `%s`, `%q`, `%x` and `fmt.Println` print the same as before [#​463](https://github.com/shopspring/decimal/pull/463)
- `Ln` rounds correctly, so some results change in the last digit: `Ln` of 10 to 5 places is `2.30259`, not `2.30258` [#​471](https://github.com/shopspring/decimal/pull/471)
- `ExpHullAbrham` returns `overallPrecision` significant figures for every input. Negative inputs used to lose digits or return 0, like `-50` at precision 10, and large inputs returned extra digits [#​429](https://github.com/shopspring/decimal/pull/429) [#​470](https://github.com/shopspring/decimal/pull/470)
- `Scan` converts `float32` with `NewFromFloat32`, so `54.33` stays `54.33` instead of becoming `54.33000183105469`. NaN and infinite floats return an error instead of panicking [#​469](https://github.com/shopspring/decimal/pull/469)
- On Go 1.10 to 1.12, `NewFromFloat` can pick a different shortest form in rare cases ([golang/go#29491](https://github.com/golang/go/issues/29491)). It still converts back to the same float [#​431](https://github.com/shopspring/decimal/pull/431)
##### FEATURES
- Add BSON Decimal128 support for `Decimal` and `NullDecimal` with the official MongoDB Go driver v2, without a new dependency [#​460](https://github.com/shopspring/decimal/pull/460)
- Add `%f` formatting with precision, width and flags, like `%.2f` and `%08.2f` [#​463](https://github.com/shopspring/decimal/pull/463)
- Add `Normalize`, which strips trailing zeros so equal decimals also match with `reflect.DeepEqual`, testify and gomock [#​464](https://github.com/shopspring/decimal/pull/464)
- Add `Sqrt` and `SqrtRound` [#​465](https://github.com/shopspring/decimal/pull/465)
- Add `Root` and `RootRound` for n-th roots [#​473](https://github.com/shopspring/decimal/pull/473)
- Add `NewFromBigFloat` constructor [#​457](https://github.com/shopspring/decimal/pull/457)
- `Scan` accepts `Decimal`, `big.Int`, `*big.Int` and all integer sizes, as passed by ClickHouse and other drivers [#​469](https://github.com/shopspring/decimal/pull/469)
##### ENHANCEMENTS
- `NewFromFloat` and `NewFromFloat32` are 3 to 6 times faster. They use `strconv` instead of a vendored copy of it from 2009, which is removed [#​431](https://github.com/shopspring/decimal/pull/431)
- `Ln` is 3 to 14 times faster [#​471](https://github.com/shopspring/decimal/pull/471)
- Slightly faster `IsInteger` and `Ceil` [#​299](https://github.com/shopspring/decimal/pull/299)
- `NewFromString` accepts the Unicode minus sign `−` (U+2212) [#​428](https://github.com/shopspring/decimal/pull/428)
- Scanning NULL into a `Decimal` returns an error that points to `NullDecimal` or `*Decimal` [#​474](https://github.com/shopspring/decimal/pull/474)
- Document that global settings aren't goroutine-safe, and list them with their per-call alternatives in the README [#​466](https://github.com/shopspring/decimal/pull/466)
- README: show how to control the JSON format of one field, add `udecimal` to the alternative libraries, and update the Go doc and playground links [#​475](https://github.com/shopspring/decimal/pull/475) [#​476](https://github.com/shopspring/decimal/pull/476) [#​264](https://github.com/shopspring/decimal/pull/264)
- Fix doc examples that were wrong or didn't compile [#​468](https://github.com/shopspring/decimal/pull/468)
- Fix benchmarks that measured their setup or the wrong function [#​467](https://github.com/shopspring/decimal/pull/467)
##### BUGFIXES
- `QuoRem` and `DivRound` panic on precision `math.MinInt32` instead of returning a wrong quotient [#​472](https://github.com/shopspring/decimal/pull/472)
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbImF1dG9tYXRlZCIsImRlcGVuZGVuY2llcyJdfQ==-->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
v1.5.0→v1.6.0Release Notes
shopspring/decimal (github.com/shopspring/decimal)
v1.6.0Compare Source
BEHAVIOR CHANGES
Decimalimplementsfmt.Formatter.%#vprints Go code that recreates the value, likedecimal.New(314, -2), instead of the struct fields, and verbs that don't apply, like%d, print%!d(decimal.Decimal=3.14).%v,%s,%q,%xandfmt.Printlnprint the same as before #463Lnrounds correctly, so some results change in the last digit:Lnof 10 to 5 places is2.30259, not2.30258#471ExpHullAbrhamreturnsoverallPrecisionsignificant figures for every input. Negative inputs used to lose digits or return 0, like-50at precision 10, and large inputs returned extra digits #429 #470Scanconvertsfloat32withNewFromFloat32, so54.33stays54.33instead of becoming54.33000183105469. NaN and infinite floats return an error instead of panicking #469NewFromFloatcan pick a different shortest form in rare cases (golang/go#29491). It still converts back to the same float #431FEATURES
DecimalandNullDecimalwith the official MongoDB Go driver v2, without a new dependency #460%fformatting with precision, width and flags, like%.2fand%08.2f#463Normalize, which strips trailing zeros so equal decimals also match withreflect.DeepEqual, testify and gomock #464SqrtandSqrtRound#465RootandRootRoundfor n-th roots #473NewFromBigFloatconstructor #457ScanacceptsDecimal,big.Int,*big.Intand all integer sizes, as passed by ClickHouse and other drivers #469ENHANCEMENTS
NewFromFloatandNewFromFloat32are 3 to 6 times faster. They usestrconvinstead of a vendored copy of it from 2009, which is removed #431Lnis 3 to 14 times faster #471IsIntegerandCeil#299NewFromStringaccepts the Unicode minus sign−(U+2212) #428Decimalreturns an error that points toNullDecimalor*Decimal#474udecimalto the alternative libraries, and update the Go doc and playground links #475 #476 #264BUGFIXES
QuoRemandDivRoundpanic on precisionmath.MinInt32instead of returning a wrong quotient #472Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.