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

Fixed "stringIsFloat" issue for huge decimal numbers #1309

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

MiroMargineanu
Copy link
Contributor

@MiroMargineanu MiroMargineanu commented Nov 20, 2024

Issue

Checking if a string is a floating number would wrongfully return false for amounts with many decimals points, such as 0.0000000011231723871623178236182376123, that exceeds the default decimal places of BigNumber.js set at 20.

Issue exists on version 3.0.11 of mx-sdk-dapp.

Fix

Added a BigNumber.set method to set the decimal places to whatever the decimals' length is. Otherwise, keep it to the default one.

Contains breaking changes

  • No
  • Yes

Updated CHANGELOG

  • No
  • Yes

Testing

  • User testing
  • Unit tests

@MiroMargineanu MiroMargineanu added the bug Something isn't working label Nov 20, 2024
@MiroMargineanu MiroMargineanu self-assigned this Nov 20, 2024
@MiroMargineanu MiroMargineanu changed the title Fixed parsing of huge decimal numbers. Fixed "stringIsFloat" issue for huge decimal numbers Nov 20, 2024
@MiroMargineanu MiroMargineanu merged commit b20b163 into development Nov 20, 2024
1 check passed
@MiroMargineanu MiroMargineanu deleted the mm-fix-string-is-float branch November 20, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants