Re: Decimal ?? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Decimal ??
Date
Msg-id 5820.959143470@sss.pgh.pa.us
Whole thread Raw
In response to Decimal ??  (Tubagus Nizomi <nizomi@dnet.net.id>)
List pgsql-sql
Tubagus Nizomi <nizomi@dnet.net.id> writes:
> I have table :
> create table test (name text, price numeric(6,2));
> but when i insert into test values ('John',3/4);
> why this value 0.00 but i want to 0.75 ??? help me please.

Offhand I'd bet that "3/4" is being interpreted as an integer
division expression.  Try "3.0/4.0" or some such if you want
a fractional result...
        regards, tom lane


pgsql-sql by date:

Previous
From: Jason Earl
Date:
Subject: Re: Decimal ??
Next
From: Michael Ma
Date:
Subject: Unable to identify a right operator '>=' for type 'bpchar'