s-yadav / react-number-format

React component to format numbers in an input or as a text.
MIT License
3.9k stars 410 forks source link

Fix Number Formatting Order in Customization #854

Closed mhl98 closed 2 months ago

mhl98 commented 3 months ago

Describe the issue/change

Problem: When typing Persian numbers from 1 to 9, there is an issue with how the numbers are displayed. Currently, the numbers appear in an incorrect order or format. For example, if you type a sequence of numbers like ۱۲۳,۴۵۶,۷۸۹ it appears as ۱۲۳,۵۶۸,۹۷۴.

https://github.com/user-attachments/assets/a0c7d9ed-aa50-4bb4-ba00-90292903911e

Expected Behavior: After the fix, when typing Persian numbers from 1 to 9, they should be displayed in the correct order and format, like ۱۲۳,۴۵۶,۷۸۹.

https://github.com/user-attachments/assets/86047fc6-0a31-4cf2-9e7f-c29b84c91810

Add CodeSandbox link to illustrate the issue (If applicable)

Describe specs for failing cases if this is an issue (If applicable)

Describe the changes proposed/implemented in this PR

Link Github issue if this PR solved an existing issue

Example usage (If applicable)

Screenshot (If applicable)

Please check which browsers were used for testing

s-yadav commented 2 months ago

Thanks for the PR. Changes looks good. Merging.