This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

round

        # BigDecimal.round

(from ruby core)
---
    round(n, mode)

---

Round to the nearest integer (by default), returning the result as a
BigDecimal if n is specified, or as an Integer if it isn't.

    BigDecimal('3.14159').round #=> 3
    BigDecimal('8.7').round #=> 9
    BigDecimal('-9.9').round #=> -10

    BigDecimal('3.14159').round(2).class.name #=> "BigDecimal"
    BigDecimal('3.14159').round.class.name #=> "Integer"

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, and return value will be an
Integer.

    BigDecimal('3.14159').round(3) #=> 3.142
    BigDecimal('13345.234').round(-2) #=> 13300

The value of the optional mode argument can be used to determine how
rounding is performed; see BigDecimal.mode.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.