Closed quangnv13 closed 2 years ago
That number is being invisibly transformed by the JavaScript runtime before it becomes an input to BigNumber because it is above Number.MAX_SAFE_INTEGER.
Your inputs to BigNumber should be strings only.
Try to avoid using the native number-type completely, because it has more problems than just this one.
That number is being invisibly transformed by the JavaScript runtime to the output you are seeing because it is above Number.MAX_SAFE_INTEGER.
Your inputs to BigNumber should be strings only.
Try to avoid using the native number-type completely, because it has more problems than just this one.
Thanks for reply
Hello everyone, now i'm using BigNumber.js for frontend of my blockchain app. It's work perfectly but some use case with uint256 value:
603563865116404668245589250390106310780736245694817307641463070622848318552
and use code bellow:new BigNumber(603563865116404668245589250390106310780736245694817307641463070622848318552).toString(10)
return value is603563865116404600000000000000000000000000000000000000000000000000000000000
. I need input number with big value and return origin value as string.Someone can help me solution for this?