-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Quantity.fromNumericalAmount, the inverse of getNumericalAmount #5052
Quantity.fromNumericalAmount, the inverse of getNumericalAmount #5052
Conversation
|
||
@Test | ||
@DisplayName("Test fromAmountInBytes method") | ||
public void testFromAmountInBytes() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make this test parameterized instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the suggestion. I made the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@rhuffy : Could you please address this minor sonar smell? |
Can we get another CI run on this? I believe I've fixed the test failures. |
bump @rohanKanojia |
Kudos, SonarCloud Quality Gate passed! |
Description
We use getNumericalAmount to do some calculations on Quantity values as BigDecimals, and sometimes we want to convert back to a Quantity of the same units. This PR pulls the format multiplier math into a separate method and implements fromNumericalAmount as the inverse of getNumericalAmount.
Type of change
test, version modification, documentation, etc.)
Checklist