Re: Convert numeric to money

From: "codeWarrior" <gpatnude(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Convert numeric to money
Date: 2005-07-28 15:41:43
Message-ID: dcatsd$2js2$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

SELECT 1032::numeric(10,2);

<lucas(at)presserv(dot)org> wrote in message
news:20050722110340(dot)4ogyzmonnny800sc(at)www(dot)presserv(dot)org(dot)(dot)(dot)
> 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
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Olivier Hubaut 2005-07-29 13:33:26 Why are these queries so different in time?
Previous Message Achilleus Mantzios 2005-07-28 06:32:46 Re: REINDEX DATABASE