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!

converting value of float out of exponential notation

Status
Not open for further replies.

TWillard

Programmer
Apr 26, 2001
263
US
The following sql returns the following: "1E-07" How can I get the select @data to return the original value of '0.0000001' without the exponent being applied and displayed?

DECLARE @data float
SET @data = '0.0000001'
select @data
 
Convert it to decimal.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks George! Either cast or convert works, so long as you specify the scale and precision. Then you have the possibility of trailing zeros to work with.

0.00000010000000000000
0.000000100


DECLARE @data float
SET @data = '0.0000001'
select cast(@data as decimal(20,20))
select convert(decimal(9,9),@data)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top