ceil

ceil(n)
Instance Public methods

Return the smallest integer greater than or equal to the value, as a BigDecimal.

BigDecimal('3.14159').ceil #=> 4
BigDecimal('-9.1').ceil #=> -9

If n is specified and positive, the fractional part of the result has no more than that many digits.

If n is specified and negative, at least that many digits to the left of the decimal point will be 0 in the result.

BigDecimal('3.14159').ceil(3) #=> 3.142
BigDecimal('13345.234').ceil(-2) #=> 13400.0
doc_ruby_on_rails
2015-03-31 06:55:45
Comments
Leave a Comment

Please login to continue.