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

JIFFY[257] - Fix: Use NumberFormat for locale-aware numeral parsing #299

Merged

Conversation

jama5262
Copy link
Owner

@jama5262 jama5262 commented Mar 20, 2025

What does this PR do?

Jiffy was failing to parse numbers in locales that use non-standard numerals (e.g., Bengali, Arabic, etc.). For example, when retrieving the day of the year, it might return ৭৮ (Bengali for 78), but Jiffy would attempt to parse it as an integer and fail.

Solution

Used NumberFormat from the Intl package to correctly convert locale-specific numerals to standard numerals.

This ensures that Jiffy can properly handle numbers from different locales without parsing errors.

Issue Reference

Fixes #257

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance change (non-breaking change such as upgrading a dependency, refactoring, or making a lint fix)
  • Documentation update
  • Breaking change (a fix or feature that would cause existing functionality to change)

Screenshots

If applicable, add screenshots to help explain your problem.

Checklist

  • Wrote additional tests, if needed
  • All tests have passed, you can find the scripts from the ./bin folder
  • I have updated the documentation accordingly, if needed.

Additional Information

Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.80%. Comparing base (830c285) to head (a120021).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #299   +/-   ##
=======================================
  Coverage   95.79%   95.80%           
=======================================
  Files          15       15           
  Lines        1452     1454    +2     
=======================================
+ Hits         1391     1393    +2     
  Misses         61       61           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jama5262 jama5262 merged commit c8f4983 into master Mar 20, 2025
5 checks passed
@jama5262 jama5262 deleted the JIFFY-257-Use-NumberFormat-for-locale-aware-numeral-parsing branch March 20, 2025 05:09
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.

DayOfYear in bengali throws FormatException
1 participant