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

ByteSize with no overload for subtraction #819

Closed
SzybkiDanny opened this issue May 25, 2019 · 2 comments
Closed

ByteSize with no overload for subtraction #819

SzybkiDanny opened this issue May 25, 2019 · 2 comments

Comments

@SzybkiDanny
Copy link

The documentation for ByteSize says:

You can also add/subtract the values using +/- operators and Add/Subtract methods

And then follows with an example:

var total = (10).Gigabytes() + (512).Megabytes() - (2.5).Gigabytes();

Unfortunately, it doesn't work and after looking at the source, I can confirm there is an appropriate overload missing for - operator.

There is, however, a unary operator defined for subtraction so one can achieve the same result with:

var total = (10).Gigabytes() + (512).Megabytes() + -(2.5).Gigabytes();

Could you, please, update the docs or add the overload.

lucianogaube added a commit to lucianogaube/Humanizer that referenced this issue Jun 4, 2019
Add new overload for Minus Operator
clairernovotny pushed a commit that referenced this issue Jun 21, 2019
Fixes issue #819 (ByteSize with no overload for subtraction) with Unit test
@SzybkiDanny
Copy link
Author

Thank you for the reaction

@lauren-van-sloun
Copy link
Contributor

It looks like this issue can be closed. 👍

jvanrhyn pushed a commit to jvanrhyn/Humanizer that referenced this issue Sep 10, 2020
Add new overload for Minus Operator
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

2 participants