Received: from qw01.qwsecure.com (qw01.qwsecure.com [209.98.210.57]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA05671 for ; Fri, 10 Sep 1999 10:35:55 -0400 (EDT) (envelope-from mwright@pro-ns.net) Received: from markw_compaq (204.124.82.48 [204.124.82.48]) by qw01.qwsecure.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id R084XANK; Fri, 10 Sep 1999 09:59:41 -0500 Message-ID: <001701befb99$c345c450$c62812ac@markw_compaq> From: "Mark Wright" To: Subject: Re: [SQL] Type Conversion: int4 -> Money Date: Fri, 10 Sep 1999 09:35:38 -0500 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 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 -----Original Message----- From: secret To: Herouth Maoz Cc: pgsql-sql@postgreSQL.org Date: Thursday, September 09, 1999 3:31 PM Subject: Re: [SQL] Type Conversion: int4 -> Money >Herouth Maoz wrote: > ... > Perl... I ended up writing my own formatting function... It has one that >does ####.## however not one that'll do the nice 123,456.33 ... :) Do you know >if there are any public modules that do such things? from the Perl Cookbook (a Perl-programmer must have!): sub commify { my $text = reverse $_[0]; $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return scalar reverse $text; } If you want a locale-using solution, and can use C, there's code in the pgsql source that does this. Look at: /src/backend/utils/adt/cash.c cash_out()