bigdecimal
bigdecimal copied to clipboard
BigDecimal#whole?
e.g. round == self
Would be nice for things like skiping the .0 in 1.0
And #whole would be alias of #round or #floor or #ceil or #truncate
@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?
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