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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Casting Exponential Notation 1

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
US
Hello,

In the past I've been able to cast exponential notation in SQL Server(2005) with something like this:

SELECT LTRIM(STR(CAST('9.99E15' AS float),100))

Which returns this output:

9990000000000000

But it seems because the values I'm dealing with now have several leading zeros so the conversion always returns 0:

SELECT LTRIM(STR(CAST('2.83E-05' AS float),100))

Output: 0

Could someone please explain what I might be missing for this solution? I guess what I'm asking is how to handle the E-05 notation specifically.

Thanks,
Larry
 
Thanks for your suggestion Mark. I'll give a try and let you know.

Best,
Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top