On 3/27/13, Steve Crawford <scrawford@pinpointresearch.com> wrote:
> Somewhat more worrisome is the fact that it automatically rounds input
> (away from zero) to fit.
>
> select '123.456789'::money;
> money
> ---------
> $123.46
So does casting to an integer:
select 1.25::integer
;
int4
----
1
And then there's this:
create table wkdata
(numval numeric(5,2))
CREATE TABLE
Time: 6.761 ms
nolan=> insert into wkdata
nolan-> values (123.456789);
INSERT 569625265 1
Time: 4.063 ms
nolan=> select * from wkdata;
select * from wkdata;
numval
------
123.46
So rounding a money field doesn't seem inconsistent with other data types.
--
Mike Nolan