Skip to content

bugfix: floating point precision issue#408

Closed
utk09-NCL wants to merge 2 commits into
cchanxzy:mainfrom
utk09-NCL:bugfix-js-floating-point-precision-issue-407
Closed

bugfix: floating point precision issue#408
utk09-NCL wants to merge 2 commits into
cchanxzy:mainfrom
utk09-NCL:bugfix-js-floating-point-precision-issue-407

Conversation

@utk09-NCL
Copy link
Copy Markdown

Fixes #407

Problem: 4.1M displayed as £NaN.1 due to JS floating-point precision errors.

Solution:

  • Created safeMultiply utility using integer arithmetic
  • Fixed parseAbbrValue and cleanValue to use safe multiplication
  • Added comprehensive test coverage

Result: 4.1M now correctly displays as £4,100,000

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (396d57b) to head (9b2362d).
⚠️ Report is 30 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #408   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        16    +1     
  Lines          414       409    -5     
  Branches       156       172   +16     
=========================================
- Hits           414       409    -5     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@utk09-NCL
Copy link
Copy Markdown
Author

@cchanxzy re:failing Playwright tests - it seems to have failed before with same error. Any suggestions/resolution? TIA!

@utk09-NCL
Copy link
Copy Markdown
Author

Hi @cchanxzy, any updates regarding this? Thanks!

@github-actions github-actions Bot added the Stale label Dec 26, 2025
@github-actions github-actions Bot closed this Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS floating point precision issue: 4.1M returns NaN.1

2 participants