Query to convert exponential number to float in SQL Server

丶灬走出姿态 提交于 2021-02-08 06:35:46

问题


I am using

SELECT CAST('5E-05' AS float) 

result = 0.00005

and it is not working. Help.

https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=5E-05+to+decimal


回答1:


Provide correct output for this so that we test and throw few more sample data.

Try this,

SELECT CONVERT(decimal(18,8), CAST('5E-05' AS FLOAT))


来源:https://stackoverflow.com/questions/36914381/query-to-convert-exponential-number-to-float-in-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!