-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(NODE-5594): add Decimal128.fromStringWithRounding() static method #617
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… works like fromString excepting inexact rounding
W-A-James
changed the title
fix(NODE-5594): wip - pre cherry pick
feat(NODE-5594): add Decimal128.fromStringWithRounding() static method
Aug 30, 2023
…mStringWithRounding to wrapper methods
5 tasks
durran
added
the
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
label
Aug 31, 2023
durran
requested changes
Aug 31, 2023
durran
approved these changes
Sep 6, 2023
durran
added
Team Review
Needs review from team
and removed
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
labels
Sep 6, 2023
W-A-James
added a commit
that referenced
this pull request
Sep 8, 2023
#617) Co-authored-by: hconn-riparian <121891959+hconn-riparian@users.noreply.github.com>
W-A-James
added a commit
that referenced
this pull request
Sep 12, 2023
#617) Co-authored-by: hconn-riparian <121891959+hconn-riparian@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is changing?
Decimal128.fromStringWithRounding
static methodtest/node/decimal128_tests.js
to typescript and add tests forfromStringWithRounding
Is there new documentation needed for these changes?
What is the motivation for this change?
NODE-5594
Release Highlight
Adds new
Decimal128.fromStringWithRounding
static methodPrior to the 6.0.0 release,
Decimal128.fromString
performed rounding behaviour by default that rounded numbers with >34 significant digits incorrectly. In addition to this bug, the intention of theDecimal128
type and specification is to provide an interface to a high-precision floating point value, so rounding by default also went against this intention, which is why that behaviour was removed from the method in the 6.0.0 release.We understand that some users may have come to rely on the rounding behaviour, so that has been corrected here and exposed via a new static method,
Decimal128.fromStringWithRounding
, which should now allow these users to migrate to the v6 of the driver.Thank you to @hconn-riparian for reporting a related rounding bug and fix in #560 which has been included in this feature.
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript