Re: create function atof?

From: Yasir Malik <ymalik(at)cs(dot)stevens-tech(dot)edu>
To: Mark Tabash <mark(dot)tabash(at)novacolor(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: create function atof?
Date: 2004-06-06 02:16:37
Message-ID: Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Is it possible to create a database function that mimics the C function atof?
> I'm guessing it should look something like this:

You can do this to convert a string to a float:
select '3.14'::float + 1;

?column?
----------
4.14
(1 row)

Is that what you want?
Yasir

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Neil Zanella 2004-06-06 08:19:50 SQL DDL: FOREIGN KEY construct and field mapping: unexpected behavior
Previous Message Tom Lane 2004-06-04 20:43:33 Re: ANSI SQL-99 SYNTAX and "WITH"