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

RoundUp() and RoundDown() with Negative Numbers #375

Open
langurs opened this issue Jul 5, 2024 · 1 comment
Open

RoundUp() and RoundDown() with Negative Numbers #375

langurs opened this issue Jul 5, 2024 · 1 comment

Comments

@langurs
Copy link

langurs commented Jul 5, 2024

The RoundUp() and RoundDown() functions treat negative numbers the opposite of what I would expect. For example, if you're rounding "up," I would expect the number -1.45 could become -1.4, but not -1.5.

The "Math is Fun" and Wikipedia websites seems to have a good description of the variations (https://www.mathsisfun.com/numbers/rounding-methods.html and https://en.wikipedia.org/wiki/Rounding).

Also, I saw no tests for negative numbers in TestDecimal_RoundAndStringFixed(), so I tried adding some, but got some strange results. You might want to try it.

@yzy613
Copy link

yzy613 commented Jul 18, 2024

See #378

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