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

round

        # Time.round

(from ruby core)
---
    time.round([ndigits])   -> new_time

---

Rounds subsecond to a given precision in decimal digits (0 digits by
default). It returns a new Time object. `ndigits` should be zero or a
positive integer.

    t = Time.utc(2010,3,30, 5,43,25.123456789r)
    t                       #=> 2010-03-30 05:43:25.123456789 UTC
    t.round                 #=> 2010-03-30 05:43:25 UTC
    t.round(0)              #=> 2010-03-30 05:43:25 UTC
    t.round(1)              #=> 2010-03-30 05:43:25.1 UTC
    t.round(2)              #=> 2010-03-30 05:43:25.12 UTC
    t.round(3)              #=> 2010-03-30 05:43:25.123 UTC
    t.round(4)              #=> 2010-03-30 05:43:25.1235 UTC

    t = Time.utc(1999,12,31, 23,59,59)
    (t + 0.4).round         #=> 1999-12-31 23:59:59 UTC
    (t + 0.49).round        #=> 1999-12-31 23:59:59 UTC
    (t + 0.5).round         #=> 2000-01-01 00:00:00 UTC
    (t + 1.4).round         #=> 2000-01-01 00:00:00 UTC
    (t + 1.49).round        #=> 2000-01-01 00:00:00 UTC
    (t + 1.5).round         #=> 2000-01-01 00:00:01 UTC

    t = Time.utc(1999,12,31, 23,59,59)     #=> 1999-12-31 23:59:59 UTC
    (t + 0.123456789).round(4).iso8601(6)  #=> 1999-12-31 23:59:59.1235 UTC



      

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.