MetaMask / MetaMask/metamask-extension

[Bug]: new BigNumber() not a number error when adding comma symbol in Perps witdraw/add and mUSD convert

Open
#44,518 2 comments 0 reactions 0 assignees View on GitHub
INVALID-ISSUE-TEMPLATE needs-triage regression-RC-13.40.0 Sev2 size-S ta-triaged team-perps type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Describe the bug**

When adding a `comma` symbol in Perps withdraw/add and mUSD convert flows amount field, the following error is displayed:

`BigNumber Error: new BigNumber() not a number: 1`

Closing and re-opening MetaMask fixes the issue

**Expected behavior**

No error

**Screenshots/Recordings**

Image

https://github.com/user-attachments/assets/6ab076cc-8f3b-4dcd-89cd-b02641c313a3

**Steps to reproduce**

1. Go to Perps Add or Withdraw or mUSD convert flow
2. Type comma in the amount fiels
3. Notice error

**Error messages or log output**

```shell
React Router caught the following error during render BigNumber Error: new BigNumber() not a number: 0, Object
```

**Where was this bug found?**

Internal release testing

**Version**

13.40.0

**Browser**

Chrome

**Operating system**

MacOS

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the Perps Add, Perps Withdraw, and mUSD convert flows using a comma in the amount field, then trace the amount handling that leads to the BigNumber render error. Done means comma input no longer produces the error and the flows continue without requiring MetaMask to be closed and reopened.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.