代码之家  ›  专栏  ›  技术社区  ›  Pranay Deep

查询以在SQL Server中将指数转换为浮点数

  •  1
  • Pranay Deep  · 技术社区  · 8 年前

    我正在使用

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

    结果=0.00005

    但它不起作用。帮助

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

    1 回复  |  直到 8 年前
        1
  •  3
  •   Abdul Rasheed    8 年前

    为此提供正确的输出,以便我们测试和抛出更多样本数据。

    试试这个,

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