Re: remove $ from money field

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Robby Russell <rrussell(at)commandprompt(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: remove $ from money field
Date: 2003-08-12 18:11:20
Message-ID: 1060711880.6031.74.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As others have said, money is deprecated. I used this function to
migrate some money data once; you could use it to reformat data if you
wanted.

CREATE OR REPLACE FUNCTION x_money(money) RETURNS decimal AS '

set moneydata $1

regsub -all {[,$]} $moneydata {} workable

return $workable

' language 'pltclu';

Robert Treat

On Fri, 2003-08-08 at 20:04, Robby Russell wrote:
> Should be a simple question.
>
> When selecting a field that is of type money, how can I remove the $
> when selected?
>
> example: $10.00 would return as 10.00
>
> -Robby
>
--
PostgreSQL :: The Enterprise Open Source Database

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-08-12 18:43:59 Re: types of constraint deferment
Previous Message Al Hulaton 2003-08-12 16:55:44 Re: Commercial support?