-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Easyeasy issueeasy issue
Description
Problem
The system is experiencing small but significant floating-point precision errors when handling currency values.
Because money is currently stored as JavaScript floating-point numbers, tiny fractions (e.g., $0.0000000004) are being lost or rounded incorrectly during calculations. Over time, this can lead to disappearing or inconsistent balances.
Points: 20
Steps to Reproduce
- Perform multiple small transfers or operations that involve decimal values.
- Inspect the resulting wallet balance in the database.
- Notice:
- Tiny fractions of currency disappear or accumulate incorrectly.
- Balances drift due to floating-point rounding issues.
Expected Behavior
Currency values must be stored and processed with full precision.
To ensure accuracy, the system should:
- Store money as integer cents (e.g.,
$10.50 → 1050) instead of floats, or - Use a reliable decimal math library (e.g.,
decimal.js,big.js), and ensure all wallet operations use it.
The database and model should be refactored so no floating-point numbers are used for currency values.
Submission Guidelines
- Comment on this issue with your proposed solution approach.
- Wait for issue assignment from reviewers.
- Create a PR with clear, descriptive commit messages.
- Reference this issue in your PR description.
Metadata
Metadata
Assignees
Labels
Easyeasy issueeasy issue