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

BigDecimal#whole? #291

Open
dorianmariecom opened this issue Mar 3, 2024 · 3 comments
Open

BigDecimal#whole? #291

dorianmariecom opened this issue Mar 3, 2024 · 3 comments

Comments

@dorianmariecom
Copy link

e.g. round == self

Would be nice for things like skiping the .0 in 1.0

@dorianmariecom
Copy link
Author

And #whole would be alias of #round or #floor or #ceil or #truncate

@mrkn
Copy link
Member

mrkn commented May 4, 2024

@dorianmariecom What specific changes are you proposing and how do you suggest we implement them? I'm having difficulty understanding from your current explanation, so could you please provide more detailed clarification?

@dorianmariecom
Copy link
Author

e.g.

class BigDecimal
  def whole
    round
  end

  def whole?
    whole == self
  end
end

So a whole method to get the whole part of a number and whole? to see if that number is whole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants