Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BalancedPayment shouldn't store amount as float #2

Open
jbafford opened this issue Jul 27, 2013 · 0 comments
Open

BalancedPayment shouldn't store amount as float #2

jbafford opened this issue Jul 27, 2013 · 0 comments

Comments

@jbafford
Copy link
Contributor

It is dangerous to store and manipulate currency values as floats, since floats with decimal values can be non-exact, and unexpected errors can creep into calculations.

It would be preferable to store values either using the decimal type (which can exactly represent decimal values), or preferably as an integer (since PHP doesn't do decimal math, and that is what the Balanced API expects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant