Skip to content

Fix: Improve crypto amount display precision#1060

Open
pwangxo-sg wants to merge 1 commit intoliquality:developfrom
pwangxo-sg:crypto-precision-fix
Open

Fix: Improve crypto amount display precision#1060
pwangxo-sg wants to merge 1 commit intoliquality:developfrom
pwangxo-sg:crypto-precision-fix

Conversation

@pwangxo-sg
Copy link

Fix Floating Point Precision Issues in Amount Display

Problem

The current implementation suffers from floating point precision errors when displaying cryptocurrency amounts. For example, calculations like 0.1 + 0.2 would display incorrectly due to JavaScript's floating point representation.

Solution

  • Implemented BigInt-based calculation to avoid floating point errors
  • Added safe arithmetic functions for crypto amounts
  • Improved decimal formatting without precision loss

Impact

  • Accurate display of cryptocurrency amounts
  • Prevention of precision-related errors in transactions
  • Better user experience with correct balance display

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant