converting error ..e-10

  • hi,

    could you explain, if and how i can convert this string to numeric?

    select isnumeric('-2.11758236814e-10')

    tells me, it is a number, but

    select convert(numeric(30,15), '-2.11758236814e-10')

    Msg 8114, Level 16, State 5, Line 1

    Error converting data type varchar to numeric.

    thank you

    Tobias

  • Try using the FLOAT data type

    select convert(float, '2.11758236814')

    you can then change this to NUMERIC if you want to as well

    select convert(numeric(30,15),(convert(float, '-2.11758236814e-10')))

  • Thank you, that works

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply