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

Implement multiple/division with decimals #32

Merged
merged 2 commits into from
Jul 13, 2020

Conversation

sjoerdsimons
Copy link
Contributor

Sometimes it's useful to multiply amounts by non-integer values; Given
Money already uses decimal internally allow it to be multiplied/divided by
decimals as well which should suitable for this.

Signed-off-by: Sjoerd Simons [email protected]

Sometimes it's useful to multiply amounts by non-integer values; Given
Money already uses decimal internally allow it to be multiplied/divided by
decimals as well which should suitable for this.

Signed-off-by: Sjoerd Simons <[email protected]>
All the multiple/division calcucation first convert the non-money type
to string which is then converted to a Decimal. That's a bit pointless
as Decimal implements the From trait for all relevant types already.

Signed-off-by: Sjoerd Simons <[email protected]>
@varunsrin
Copy link
Owner

Thank you for putting this together, I'm supportive of adding this feature.

@varunsrin varunsrin merged commit 5333da1 into varunsrin:master Jul 13, 2020
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

Successfully merging this pull request may close these issues.

2 participants