D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Time
/
Filename :
round-i.ri
back
Copy
U:RDoc::AnyMethod[iI" round:ETI"Time#round;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"HReturns a new +Time+ object whose numeric value is that of +self+, ;TI";with its seconds value rounded to precision +ndigits+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"5t = Time.utc(2010, 3, 30, 5, 43, 25.123456789r) ;TI"7t # => 2010-03-30 05:43:25.123456789 UTC ;TI"-t.round # => 2010-03-30 05:43:25 UTC ;TI"-t.round(0) # => 2010-03-30 05:43:25 UTC ;TI"/t.round(1) # => 2010-03-30 05:43:25.1 UTC ;TI"0t.round(2) # => 2010-03-30 05:43:25.12 UTC ;TI"1t.round(3) # => 2010-03-30 05:43:25.123 UTC ;TI"2t.round(4) # => 2010-03-30 05:43:25.1235 UTC ;TI" ;TI"+t = Time.utc(1999, 12,31, 23, 59, 59) ;TI"3t # => 1999-12-31 23:59:59 UTC ;TI"3(t + 0.4).round # => 1999-12-31 23:59:59 UTC ;TI"3(t + 0.49).round # => 1999-12-31 23:59:59 UTC ;TI"3(t + 0.5).round # => 2000-01-01 00:00:00 UTC ;TI"3(t + 1.4).round # => 2000-01-01 00:00:00 UTC ;TI"3(t + 1.49).round # => 2000-01-01 00:00:00 UTC ;TI"3(t + 1.5).round # => 2000-01-01 00:00:01 UTC ;T:@format0o; ; [I"$Related: Time#ceil, Time#floor.;T: @fileI"time.c;T:0@omit_headings_from_table_of_contents_below0I"$round(ndigits = 0) -> new_time ;T0[ I"(*args);T@&FI" Time;TcRDoc::NormalClass00