Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group