How do I convert exponential notation into numeric?

Moderator: NorbertKrupa

Post Reply
billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

How do I convert exponential notation into numeric?

Post by billykopecki » Fri Nov 15, 2013 4:45 pm

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?

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: How do I convert exponential notation into numeric?

Post by id10t » Fri Nov 15, 2013 5:44 pm

Hi!

[DELETED]
Last edited by id10t on Sat May 09, 2015 3:17 pm, edited 1 time in total.

billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Re: How do I convert exponential notation into numeric?

Post by billykopecki » Fri Nov 15, 2013 8:04 pm

Oops! That does convert cleanly...

Code: Select all

dbadmin=> select '4.275e-02'::numeric cool;
  cool
---------
 0.04275
(1 row)
For some dumb reason I was doing this:

Code: Select all

dbadmin=> select '4.275e-02'::int oops;
ERROR 3681:  Invalid input syntax for integer: "4.275e-02"
Thanks for your help!

Post Reply

Return to “Vertica Data Load”