-
Notifications
You must be signed in to change notification settings - Fork 56
Better handle large integers #2062
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
Conversation
|
|
||
| // parse huge integer values into a bigint, and use a regular number otherwise | ||
| export function customNumberParser(value) { | ||
| return isSafeNumber(value) ? parseFloat(value) : BigInt(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing an exception because isSafeNumber was false for floating point numbers that can not be represented like 0.66666666666. So then BigInt was trying to create an integer from a float and was failing.
This fixes the screen error that was showing up in the Demo on the INST ADCS screen.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2062 +/- ##
==========================================
- Coverage 79.15% 79.12% -0.03%
==========================================
Files 631 631
Lines 47536 47536
Branches 754 754
==========================================
- Hits 37627 37614 -13
- Misses 9826 9839 +13
Partials 83 83
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No description provided.