Home All Groups Group Topic Archive Search About

Convert varchar to numeric

Author
28 Jul 2005 3:59 PM
Terri
I have a varchar value like -2.47382558882236E-10. How can I convert this
to -2.47382558882236 in order to then convert to numeric. Logically I want
to truncate everything after the 14th digit to the right of the decimal
point.

Thanks for any help.

Author
28 Jul 2005 4:33 PM
Alejandro Mesa
Try,

select cast(cast('-2.47382558882236E-10' as float) as decimal(16, 14))
go


AMB

Show quote
"Terri" wrote:

> I have a varchar value like -2.47382558882236E-10. How can I convert this
> to -2.47382558882236 in order to then convert to numeric. Logically I want
> to truncate everything after the 14th digit to the right of the decimal
> point.
>
> Thanks for any help.
>
>
>

AddThis Social Bookmark Button