Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISNUMERIC and Floating Point 1

Status
Not open for further replies.

andrewwatson

Programmer
Jul 16, 2002
10
GB
If you pass ISNUMERIC a string containing a floating point number in scientific format (eg 1.23E4), it returns 1 (i.e. it is a number). However, if you then try to convert (explicit or implicit) this string to Decimal , you get a data conversion error.

Is there any way of converting such numbers easily (I'd rather not have to scan the string for "E"s and multiply by powers of ten if I can avoid it.
 
You can convert the character string to float and then to decimal.

Select
DecNum=convert(decimal(20,10), convert(float, FloatNum))
From tablename Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top