Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 942084762D1 for ; Tue, 17 Sep 2002 01:33:46 -0400 (EDT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 0C1E847629E for ; Tue, 17 Sep 2002 01:33:45 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g8H5XQq29077; Tue, 17 Sep 2002 01:33:26 -0400 (EDT) From: Bruce Momjian Message-Id: <200209170533.g8H5XQq29077@candle.pha.pa.us> Subject: Re: Formatting zeroes In-Reply-To: To: Josh Berkus Date: Tue, 17 Sep 2002 01:33:26 -0400 (EDT) Cc: Ludwig Lim , PostgreSQL Mailing List X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/188 X-Sequence-Number: 9465 Josh Berkus wrote: > Ludwig, > > > I'm trying to use SQL to generate a formatted > > report. The "to_char(numeric,'FM9,999,999,999.99')" > > function works when I use it format numbers with > > decimal points and appropriate commas. > > Is there a format specifier in the to_char function > > that it will display 0 as "0" or "0.0"? > > "to_char(numeric,'FM9,999,999,999.09')" And we know it is a bug: * to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073