margelo / react-native-bignumber

🔢 The fastest Big Number library for React Native
https://margelo.io
MIT License
342 stars 12 forks source link

Fix: Ensure correct hexadecimal representation for .toString('hex') and .toString(16) methods #61

Closed nnnoel closed 12 months ago

nnnoel commented 1 year ago

Fixes #60

Root Cause

The original implementation of the toString method was designed to only handle numerical base representations. When a string-based representation like 'hex' was passed to the method, it was not recognized or processed, and the method defaulted to returning the decimal string representation of the number (base = 10)

Summary:

mrousavy commented 1 year ago

Hey, thanks for your PR this looks good!