ripple / explorer

Open Source XRP Ledger Explorer
https://livenet.xrpl.org/
MIT License
95 stars 61 forks source link

Use `BigNumber` instead of `number` type for amount #968

Open shawnxie999 opened 3 months ago

shawnxie999 commented 3 months ago

For amount field, it has the number type which can support around 53 bit number. However, an issue currency amount has the maximum value of 9999999999999999 * 10^80, which is not a value that number can store. Explorer should change to a type(eg. BigNumber) that can store these large values. This would likely affect a lot of places in the repo, such as helper functions.

Awais2662 commented 3 months ago

5300000000

On Tue, 2 Apr 2024, 2:21 am Shawn Xie, @.***> wrote:

For amount https://github.com/ripple/explorer/blob/2835d72c98a5106378b6c8b456df82b6f4582327/src/containers/shared/types.ts field, it has the number type which can support around 53 bit number. However, an issue currency amount has the maximum value of 9999999999999999

  • 10^80, which is not a value that number can store. Explorer should change to a type(eg. BigNumber) that can store these large values. This would likely affect a lot of places in the repo, such as helper functions.

— Reply to this email directly, view it on GitHub https://github.com/ripple/explorer/issues/968, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6G5GTNYXQLSXD4432N4LTLY3HFVVAVCNFSM6AAAAABFSHDUHWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTSMBYGYZDGOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pdp2121 commented 3 months ago

Thanks @shawnxie999 for raising the issue! We have added this ticket to our backlog