fix: invalid float number format by json-bigint #21996
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
In #21968, it replaces the
json-bigint
byjson-bigint-native
to fix the invalid float number handling by escaping BigNumber(BigInt) wrapper.However,
json-bigint-native
uses native BigInt only which has limit compatibility of Math functions that throws TypeError several cases.This commit reverts the commit in order to keep it back to use
BigNumber
(which is compatible with Math functions).Instead it adds a custom logic to escape the BigNumber for floating numbers. It also adds a
todo
comment to fix the root cause by open source in the future.cc: @john-bodley @ktmud @villebro @zhaoyongjie
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: (returns NaN values)
After:
TESTING INSTRUCTIONS
Create a chart with floating numbers
ADDITIONAL INFORMATION