Some values, e.g. 0.254182 are represented in Perl as0.2541820000000000190354399. When such values are stored in PostgreSQL and then fetched and converted to DateTime object with DateTime::Format::Pg, DateTime object contains the floating point nanosecond value, in this example 254182000.0000000298023223876953125, which leads to problems with DateTime comparison later.
I think DateTime::Format::Pg should convert nanoseconds to an integer value, i.e. _fix_nanosecond should round the result to avoid such problem.
Some values, e.g.
0.254182
are represented in Perl as0.2541820000000000190354399
. When such values are stored in PostgreSQL and then fetched and converted toDateTime
object withDateTime::Format::Pg
,DateTime
object contains the floating point nanosecond value, in this example254182000.0000000298023223876953125
, which leads to problems withDateTime
comparison later.I think
DateTime::Format::Pg
should convert nanoseconds to an integer value, i.e._fix_nanosecond
should round the result to avoid such problem.