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 C906F5291C for ; Thu, 28 Jul 2005 12:33:50 -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 82165-10 for ; Thu, 28 Jul 2005 15:33:42 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2DD7B52941 for ; Thu, 28 Jul 2005 12:33:37 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id DF95D30B42; Thu, 28 Jul 2005 17:41:10 +0200 (MET DST) From: "codeWarrior" X-Newsgroups: pgsql.sql Subject: Re: Convert numeric to money Date: Thu, 28 Jul 2005 08:41:43 -0700 Organization: Hub.Org Networking Services Lines: 35 Message-ID: References: <20050722110340.4ogyzmonnny800sc@www.presserv.org> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.232 tagged_above=0 required=5 tests=AWL, FORGED_HOTMAIL_RCVD2, PRIORITY_NO_NAME X-Spam-Level: ** X-Archive-Number: 200507/239 X-Sequence-Number: 22217 SELECT 1032::numeric(10,2); wrote in message news:20050722110340.4ogyzmonnny800sc@www.presserv.org... > Hi. > I have searched in mailing-list archives about converting types, but I > couldn't > found a function or clause that convert a numeric type to money type. > How Can I convert this types? > > => select '1234'::money; > money > ------------ > R$1.234,00 > > => select '1234'::numeric::money; > ERROR: cannot cast type numeric to money > > The problem is becouse I have a table with "numeric" field, and I need to > show > it like "money" type (R$ 1.234,00). Is there a function to convert it??? > Or is > there a function to mask the numeric field to show like money (with > R$x.xxx,xx)??? > > Thanks. > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >