Re: Decimal ??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tubagus Nizomi <nizomi(at)dnet(dot)net(dot)id>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Decimal ??
Date: 2000-05-24 04:44:30
Message-ID: 5820.959143470@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tubagus Nizomi <nizomi(at)dnet(dot)net(dot)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

In response to

  • Decimal ?? at 2000-05-24 02:55:51 from Tubagus Nizomi

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Ma 2000-05-24 15:21:39 Unable to identify a right operator '>=' for type 'bpchar'
Previous Message Jason Earl 2000-05-24 04:43:10 Re: Decimal ??