pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bart Ogryczak <bart@bart.w-wa.pl>
To: pgsql-sql@postgresql.org
Subject: converting text to float?
Date: Thu, 12 Aug 1999 14:32:22 +0200
Message-ID: <37B2BED6.1F7005E2@bart.w-wa.pl> (raw)

Hey,
I'm trying hard to convert text to float, and all i get are 
messages like this:

select float4(wartosc) from  tblwartosci ;
ERROR:  Function 'float4(text)' does not exist
        There is more than one function that satisfies the given
argument types
        You will have to retype your query using explicit typecasts

select float4(int(wartosc)) from  tblwartosci ;
ERROR:  pg_atoi: error in "285.75": can't parse ".75"

Table    = tblwartosci
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                |
Length|
+----------------------------------+----------------------------------+-------+
.
.
| wartosc                          | text                            
|   var |
+----------------------------------+----------------------------------+-------+

Is there a resonable way to do text to float conversion?

bart
-- 
bart@bart.w-wa.pl || http://www.bart.w-wa.pl



Message-ID: <37B2BED6.1F7005E2@bart.w-wa.pl>
Permalink:  ../37B2BED6.1F7005E2@bart.w-wa.pl/
Also on:    postgresql.org/message-id/37B2BED6.1F7005E2@bart.w-wa.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bart@bart.w-wa.pl
  Subject: Re: converting text to float?
  In-Reply-To: <37B2BED6.1F7005E2@bart.w-wa.pl>
  References: <37B2BED6.1F7005E2@bart.w-wa.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox