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: Arabic decimals #1174

Merged
merged 2 commits into from
Jul 30, 2023
Merged

fix: Arabic decimals #1174

merged 2 commits into from
Jul 30, 2023

Conversation

Syn-McJ
Copy link
Member

@Syn-McJ Syn-McJ commented Jul 27, 2023

In Arabic locales, there is a different comma character used as a decimal separator, which is distinct from the comma in other locales. This causes a crash in the Amount Input control.

Issue being fixed or feature implemented

  • Add Arabic comma in formatFiatWithoutComma logic
  • Some other RTL fixes

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@Syn-McJ Syn-McJ self-assigned this Jul 27, 2023
} else {
fiatValue.replace(",".toRegex(), ".")
fiatValue.replace(",", ".")
.replace("٫", ".")
Copy link
Member Author

@Syn-McJ Syn-McJ Jul 27, 2023

Choose a reason for hiding this comment

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

At first, I wanted to parse the input in a "proper" manner with the current device locale, however, this proved problematic because formatFiatWithoutComma often receives input in US format.

At some point, we might want to unify the way decimal separators are presented to the users in different locales, but it will require a bit of work and extensive testing. For now, this fix should suffice.

@HashEngineering HashEngineering merged commit 7222fed into master Jul 30, 2023
3 checks passed
@Syn-McJ Syn-McJ deleted the fix-decimals-arabic branch August 1, 2023 14:17
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