mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] Improve documentation for Time#floor
Use numbers that are more illustrative for #floor.
This commit is contained in:
parent
f782e5bdcf
commit
cc0e460bcc
1 changed files with 2 additions and 4 deletions
6
time.c
6
time.c
|
@ -4258,11 +4258,9 @@ time_round(int argc, VALUE *argv, VALUE time)
|
|||
*
|
||||
* t = Time.utc(1999,12,31, 23,59,59)
|
||||
* (t + 0.4).floor.iso8601(3) #=> "1999-12-31T23:59:59.000Z"
|
||||
* (t + 0.49).floor.iso8601(3) #=> "1999-12-31T23:59:59.000Z"
|
||||
* (t + 0.5).floor.iso8601(3) #=> "1999-12-31T23:59:59.000Z"
|
||||
* (t + 0.9).floor.iso8601(3) #=> "1999-12-31T23:59:59.000Z"
|
||||
* (t + 1.4).floor.iso8601(3) #=> "2000-01-01T00:00:00.000Z"
|
||||
* (t + 1.49).floor.iso8601(3) #=> "2000-01-01T00:00:00.000Z"
|
||||
* (t + 1.5).floor.iso8601(3) #=> "2000-01-01T00:00:00.000Z"
|
||||
* (t + 1.9).floor.iso8601(3) #=> "2000-01-01T00:00:00.000Z"
|
||||
*
|
||||
* t = Time.utc(1999,12,31, 23,59,59)
|
||||
* (t + 0.123456789).floor(4).iso8601(6) #=> "1999-12-31T23:59:59.123400Z"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue