-
Notifications
You must be signed in to change notification settings - Fork 393
Negative stones and pounds conversion wrong under 1 stone #572
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
Comments
Thanks for reporting, would you be interested in debugging this and doing a pull request? |
I'm now looking into it, but have to be honest that units/math is not my strongest point, hence the use of this library for my project, so I'm not sure how much help I can be. |
Just ask if you get stuck on something you don't understand. I recommend starting with and adding a new test case as you wrote above, then debug why it fails by stepping through the code calls. You should be able to spot where it goes wrong. Use some values that are easy to reason about. My gut feeling tells me we have a rounding-error, so it rounds stones "down" to a more negative value than it should, since we have only tested positive values before. |
Bad math using Math.Floor on negative numbers. Was also incorrect for feet/inches. Fix in PR #573. |
Nuget 3.111 on the way out. |
Fiddle here.
I'd expect this to show -0 st -1lb but currently displays -1 st -1 lb. P.S Love the library, thanks!
The text was updated successfully, but these errors were encountered: