Returns the value as an Integer
.
If the BigDecimal
is infinity or NaN, raises FloatDomainError
.
Converts a BigDecimal
to a String
of the form “nnnnnn.mmm”. This method is deprecated; use BigDecimal#to_s
(“F”) instead.
require 'bigdecimal/util' d = BigDecimal("3.14") d.to_digits # => "3.14"
return the JSON
value
Deserializes JSON
string by converting numerator value n
, denominator value d
, to a Rational
object.
Returns true if the given ordinal date is valid, and false if not.
Date.valid_ordinal?(2001,34) #=> true Date.valid_ordinal?(2001,366) #=> false
Duplicates self and resets its day of calendar reform.
d = Date.new(1582,10,15) d.new_start(Date::JULIAN) #=> #<Date: 1582-10-05 ...>
This method is equivalent to d - n.
This method is equivalent to d << (n * 12).
Date.new(2001,2,3).prev_year #=> #<Date: 2000-02-03 ...> Date.new(2008,2,29).prev_year #=> #<Date: 2007-02-28 ...> Date.new(2008,2,29).prev_year(4) #=> #<Date: 2004-02-29 ...>
See also Date#<<
.
Returns a Time
object which denotes self. If self is a julian date, convert it to a gregorian date before converting it to Time
.
Returns self.
Returns a DateTime
object which denotes self.
Deserializes JSON
string by converting Julian year y
, month m
, day d
and Day of Calendar Reform sg
to Date
.
Stores class name (Date
) with Julian year y
, month m
, day d
and Day of Calendar Reform sg
as JSON
string
Returns a Time
object which denotes self.
Returns a Date
object which denotes self.
Returns self.
Deserializes JSON
string by converting year y
, month m
, day d
, hour H
, minute M
, second S
, offset of
and Day of Calendar Reform sg
to DateTime
.