Good morning!
I have a data file that has a bunch of numbers that use exponential notation, i.e.:
4.275e-02
1.063e+00
8.532e-01
4.779e-01
Is there a way to convert these values into a numeric column in the copy command?
How do I convert exponential notation into numeric?
Moderator: NorbertKrupa
-
- Beginner
- Posts: 42
- Joined: Thu Apr 19, 2012 9:03 pm
Re: How do I convert exponential notation into numeric?
Hi!
[DELETED]
[DELETED]
Last edited by id10t on Sat May 09, 2015 3:17 pm, edited 1 time in total.
-
- Beginner
- Posts: 42
- Joined: Thu Apr 19, 2012 9:03 pm
Re: How do I convert exponential notation into numeric?
Oops! That does convert cleanly...
For some dumb reason I was doing this:
Thanks for your help!
Code: Select all
dbadmin=> select '4.275e-02'::numeric cool;
cool
---------
0.04275
(1 row)
Code: Select all
dbadmin=> select '4.275e-02'::int oops;
ERROR 3681: Invalid input syntax for integer: "4.275e-02"