Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: MathX.Round() - fixing some instances of incorrect rounding and addin… #111

Merged
merged 1 commit into from
May 3, 2018

Conversation

tristanjthompson
Copy link

During a project a while ago I found an edge case a while ago whereby the MathX.Round() function wasn't matching the output of Excel. At the time I downloaded the NPOI source, made a fix and incorporated it into the project. I've since realised I should have created a PR for it (which is what this is!). I posted the change on Stackoverflow here: https://stackoverflow.com/questions/41467799/npoi-round-formula/41961253#41961253

In summary - the value 481.75478 should round to 481.75, however, it was rounding to 481.76

I have:

  • run the "TestRound()" test function and saw it pass
  • added the above case to the list of scenarios in "TestRound()" and saw it fail
  • added my fix and saw "TestRound()" pass again

@tristanjthompson tristanjthompson changed the title MathX.Round() - fixing some instances of incorrect rounding and addin… Fix: MathX.Round() - fixing some instances of incorrect rounding and addin… Jan 31, 2018
@tristanjthompson
Copy link
Author

@tonyqus is there any more information you need from me or any changes you'd like me to make in order for this to be merged?

@tonyqus
Copy link
Member

tonyqus commented May 3, 2018

If Unit test is passed, I don't have any concern. Thank you for your efforts.

@tonyqus tonyqus merged commit 09e6b06 into nissl-lab:master May 3, 2018
@tristanjthompson tristanjthompson deleted the bugfix/round-function branch May 4, 2018 00:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants