-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeError: Decimal\Decimal::add() expected parameter 1 to be a string, integer, or decimal #57
Comments
Given that this is a library for accurate decimal arithmetic and floats use inaccurate decimal representations (eg. 0.1), the decision to disallow float was to encourage an avoidance of float entirely. If a float is on hand, such as one returned by another library or legacy component, the responsibility to convert to string is placed on the caller as an explicit decision. Could you please share some examples where you find it a nuisance? I am open to relaxing this. |
With this I no longer have to worry about whether the data is NULL, float or has spaces. |
Why Decimal does not accept float? It is a nuisance to make use of strval() or (string) in addition to checking that it is not NULL or empty.
The text was updated successfully, but these errors were encountered: