pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tubagus Nizomi <nizomi@dnet.net.id>
Cc: pgsql-sql@postgresql.org
Subject: Re: Decimal ??
Date: Wed, 24 May 2000 00:44:30 -0400
Message-ID: <5820.959143470@sss.pgh.pa.us> (raw)
In-Reply-To: <00052410061402.00709@nizomi.dnet.net.id>
References: <00052410061402.00709@nizomi.dnet.net.id>

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



view thread (6+ messages)

Message-ID: <5820.959143470@sss.pgh.pa.us>
Permalink:  ../5820.959143470@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5820.959143470@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nizomi@dnet.net.id
  Subject: Re: Decimal ??
  In-Reply-To: <5820.959143470@sss.pgh.pa.us>
  References: <00052410061402.00709@nizomi.dnet.net.id> <5820.959143470@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox