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 3AE5E52824 for ; Fri, 22 Jul 2005 11:03:49 -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 94122-03 for ; Fri, 22 Jul 2005 14:03:43 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema.dnscenter.com.br [67.15.81.98]) by svr1.postgresql.org (Postfix) with ESMTP id 867755288E for ; Fri, 22 Jul 2005 11:03:40 -0300 (ADT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.51) id 1Dvy7o-0006eJ-Ep for pgsql-sql@postgresql.org; Fri, 22 Jul 2005 11:03:40 -0300 Received: from 200.158.186.109 ([200.158.186.109]) by www.presserv.org (Horde) with HTTP for ; Fri, 22 Jul 2005 11:03:40 -0300 Message-ID: <20050722110340.4ogyzmonnny800sc@www.presserv.org> Date: Fri, 22 Jul 2005 11:03:40 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Convert numeric to money MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iracema.dnscenter.com.br X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 502] / [47 12] X-AntiAbuse: Sender Address Domain - presserv.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.041 tagged_above=0 required=5 tests=AWL, NO_REAL_NAME, RCVD_IN_NJABL_PROXY X-Spam-Level: * X-Archive-Number: 200507/191 X-Sequence-Number: 22169 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.