rainbow-me / rainbowkit

The best way to connect a wallet 🌈 🧰

Home Page:https://rainbowkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Invalid balance formatting shows balance in exponential format

brijeshagal opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

^2.0.0

wagmi Version

^2.5.7

Current Behavior

When the balance is quite small, the wallet shows balance in exponential format as seen in screenshot below:
image

Expected Behavior

Balance should be shown in numeric form and not in scientific notation.

Steps To Reproduce

Very low balance on Base chain caused this. If balance is around 0.0000009 (simply 7 decimals), scientific notation is seen.

User Address: 0x1c512FaA65B2C9660bBe7c01f83Bc7bF175B700B

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

commented

@brijeshagal The formatted balance comes from useBalance hook from wagmi. You can raise a PR to their repo if you consider this an issue.

Wagmi github repo link: https://github.com/wevm/wagmi