Skip to content
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

[AAE-20769] Fix precision for incoming values in bigdecimal field #9434

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

BSekula
Copy link
Contributor

@BSekula BSekula commented Mar 15, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)

What is the new behaviour?

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Copy link
Contributor

@DudaRobert DudaRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo and minor suggestions :)

});
});

it('should return field with proepr precisison', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('should return field with proepr precisison', () => {
it('should return field with proper precisison', () => {

expect(parsedField.value).toBe('10.104');
});

it('should NOT round up number', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('should NOT round up number', () => {
it('should NOT round up number, when removed fraction part starts with number smaller than 5 ', () => {

expect(parsedField.value).toBe('10.104');
});

it('should round up number, when removed fraction part starts with number 5 ', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('should round up number, when removed fraction part starts with number 5 ', () => {
it('should round up number, when removed fraction part starts with number larger than 4 ', () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to when removed fraction part starts with number larger or equal 5

Want to emphasis the boundary, which is 5 here :)

@BSekula BSekula force-pushed the dev-bsekula-AAE-20769-default-precision-fix branch from 23c6014 to 7daa5ae Compare March 15, 2024 13:27
@BSekula BSekula force-pushed the dev-bsekula-AAE-20769-default-precision-fix branch from 7daa5ae to 5f4a28a Compare March 18, 2024 08:27
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
14.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@BSekula BSekula merged commit 69de85a into develop Mar 18, 2024
32 of 33 checks passed
@BSekula BSekula deleted the dev-bsekula-AAE-20769-default-precision-fix branch March 18, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants