Re: allowing ',' (comma) in float8 - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: allowing ',' (comma) in float8
Date
Msg-id 20050619122545.GA32482@wolff.to
Whole thread Raw
In response to allowing ',' (comma) in float8  (stig erikson <stigerikson_nospam_@yahoo.se>)
List pgsql-novice
On Sun, Jun 12, 2005 at 12:17:12 +0200,
  stig erikson <stigerikson_nospam_@yahoo.se> wrote:
> hi.
> is it possible to use flort values with a comma as decimal placeholder?
>
> i am trying to use copy to insert a table, the table contains a few columns
> with numerical values such as price, the vales are given on the format
> "2345,12", postgresql seems to allow only "2345.12".
>
> can i change the behavior on postgresql to allow ',' as decimal placeholder?
>
> postgresql 7.4.6

It looks like you can probably use to_number to convert the input string
to numeric if ',' is the decimal separator in the locale you are using.
You can then cast the numeric value to float.

pgsql-novice by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: [despammed] allowing ',' (comma) in float8
Next
From: Bruno Wolff III
Date:
Subject: Re: Storing an array to Postgresql table