We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
round2 does not reliably solve the issue of round not behaving in the expected way.
round2
round
round2(2.5) #> 2
It seems to be an issue with (number + .Machine$double.eps) == number being true for numbers greater than 2. Perhaps it would make sense to implement round2 as in this link? https://stackoverflow.com/questions/12688717/round-up-from-5/12688836#12688836 This is what janitor references in its implementation of round_half_up: https://github.com/sfirke/janitor/blob/main/R/round_half_up.R
(number + .Machine$double.eps) == number
janitor
round_half_up
The text was updated successfully, but these errors were encountered:
Thank you for reporting! Gah, I hate that simple rounding is made difficult in R!
Sorry, something went wrong.
round2()
Successfully merging a pull request may close this issue.
round2
does not reliably solve the issue ofround
not behaving in the expected way.It seems to be an issue with
(number + .Machine$double.eps) == number
being true for numbers greater than 2. Perhaps it would make sense to implementround2
as in this link? https://stackoverflow.com/questions/12688717/round-up-from-5/12688836#12688836 This is whatjanitor
references in its implementation ofround_half_up
: https://github.com/sfirke/janitor/blob/main/R/round_half_up.RThe text was updated successfully, but these errors were encountered: