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

truncate

        # Integer.truncate

(from ruby core)
---
    truncate(ndigits = 0) -> integer

---

Returns `self` truncated (toward zero) to a precision of `ndigits`
decimal digits.

When `ndigits` is negative, the returned value has at least
`ndigits.abs` trailing zeros:

    555.truncate(-1)  # => 550
    555.truncate(-2)  # => 500
    -555.truncate(-2) # => -500

Returns `self` when `ndigits` is zero or positive.

    555.truncate     # => 555
    555.truncate(50) # => 555

Related: Integer#round.



      

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.