X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6C4FF53318 for ; Mon, 2 May 2005 01:11:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27095-01 for ; Mon, 2 May 2005 04:11:33 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by svr1.postgresql.org (Postfix) with ESMTP id 040985321E for ; Mon, 2 May 2005 01:11:32 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so1618336wra for ; Sun, 01 May 2005 21:11:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=YpMkYQP6/O2xL9yB94jxvlgCQh1olD/wlYfR0FqRdd2Fgpm+m8Wtp9tplAzeHIXFVakK/1jX6y/IHdZY7dPeSJagVc7n9i68grCJvbp50yF2pBPctWWdiidM8paCfwfeDl0P7CpmTzkFBhKp5L1fJUGMU3IMNKc5AHSYQIoa8ZI= Received: by 10.54.34.21 with SMTP id h21mr376849wrh; Sun, 01 May 2005 21:11:32 -0700 (PDT) Received: from server ([210.245.52.101]) by mx.gmail.com with ESMTP id d16sm1676071wra.2005.05.01.21.11.31; Sun, 01 May 2005 21:11:32 -0700 (PDT) Message-ID: <000b01c54ecd$869ee670$0201a8c0@server> From: "hatuan" To: References: <20050429205407.B60676@megazone.bigpanda.com> Subject: Re: Division in Postgre Date: Mon, 2 May 2005 11:15:04 +0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.914 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/8 X-Sequence-Number: 21321 Thank you ----- Original Message ----- From: "Stephan Szabo" To: "tuan" Cc: Sent: Saturday, April 30, 2005 10:56 AM Subject: Re: [SQL] Division in Postgre > On Sun, 24 Apr 2005, tuan wrote: > > > In sql server my division select cast(3 as float)/10 is 0.29999999999. > > But in postgres select cast(3 as float8)/10 is 0.3. How to get result like > > sql server? > > I believe you can control what precision is used in printing the float > results with extra_float_digits. I believe setting it to 2 will give a > 0.29... result however it has more 9s than the above. > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly