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

Fix/tr 6116/parse float thousands separator fix #185

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

taopkorczak
Copy link
Contributor

Related to: https://oat-sa.atlassian.net/browse/TR-6116

In locale.js, the thousandsSeparator was only replacing the value with an empty string, which caused a bug where the number 3,14 was converted to 314. The expectation is that the number after the thousandsSeparator will be ignored and send as 3.

To achieve that, I prepared a regex that transforms only groups of 3 digits after the thousandsSeparator to a number and ignores less and more than 3 digits.
Examples:
3,14 => 3
3,1 => 3
3,123 => 3123
23,123 => 23123
23,1234 =>23

Copy link

Version

Target Version 3.1.1
Last version 3.1.0

There are 0 BREAKING CHANGE, 0 feature, 3 fixes

Copy link

Coverage Report

Totals Coverage
Statements: 90.81% ( 2627 / 2893 )
Methods: 95.24% ( 600 / 630 )

Copy link
Contributor

@oatymart oatymart left a comment

Choose a reason for hiding this comment

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

I see that it's working: TextEntry submits the expected value for all the number formats I tried.

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful
  • Pull request's target is not master (or main) - or is a release
  • Bundled code is present if needed
  • Version bump is applied if needed (packages AND root)
  • Commits are following conventional commits
  • Commits messages are meaningful
  • Commits are atomic
  • Changelog is updated according to changes (if applicable)
  • Documentation is updated according to changes (if applicable)

Copy link
Member

@wazelin wazelin left a comment

Choose a reason for hiding this comment

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

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • New code is not subject to concurrency issues (if applicable)
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful
  • Pull request's target is not master

@wazelin wazelin merged commit 32faab2 into develop Jun 13, 2024
3 of 4 checks passed
@wazelin wazelin deleted the fix/TR-6116/parseFloat-thousandsSeparator-fix branch June 13, 2024 13: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.

3 participants