convert scientific notation to to decimal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmitri
    New Member
    • Dec 2006
    • 2

    #1

    convert scientific notation to to decimal

    I am importing a bunch of data which is all in varchar format which I cast into the relevant type on transfer to the production table. One of these columns contains decimals, but some of them are occasionally given in scientific notation (3.48E-02).
    I am using

    CAST (v1 AS decimal(18, 13))

    to do the conversion, but that seems to be unable to handle the scientific notation. Does anyone know a way around this?
  • John Tighe
    New Member
    • Mar 2007
    • 1

    #2
    Try converting to float first, like this:
    CAST (CAST (v1 AS float(24)) AS decimal(18, 13))

    Comment

    Working...