Skip to content

Conversation

@jaffarkeikei
Copy link

What changed? Why?

getRoundedAmount now validates fractionDigits parameter to prevent RangeError crashes. toFixed() only accepts values 0-100.

Notes to reviewers

Without validation, passing negative or >100 values causes:

getRoundedAmount('123.456', -1)  // RangeError: toFixed() digits argument must be between 0 and 100

Fix returns original balance for invalid inputs.

How has it been tested?

Manual testing with edge cases:

  • Negative fractionDigits: returns original balance
  • 100 fractionDigits: returns original balance

  • Valid range (0-100): works as expected

@cb-heimdall
Copy link

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@vercel
Copy link

vercel bot commented Jan 29, 2026

@jaffarkeikei is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants