小编Vic*_*tor的帖子

为什么float.parse返回错误的值?

我有个问题.当我解析像"0.005"这样的字符串浮动或双重时,它在我的计算机上工作正常,但当我将程序安装到客户端的计算机时,它返回5.(我的计算机和客户端的计算机都使用的是Windows 7 x64) .这是我的例子

public float getFloat()
    {
        float mn = float.Parse("0.005");
        double mn2 = Convert.ToDouble("0.005");
        return mn;
    }
Run Code Online (Sandbox Code Playgroud)

c# floating-point parsing numbers floating

12
推荐指数
1
解决办法
1951
查看次数

如何选择不同条件的同一列?

我试图从两个表中选择数据.
-warehouse有两列:warehouseId,warehouseName
-transportation有三列:transporter,warehouseId1,warehouseId2
我想从两个表中选择并从表A获取warehouseName for warehouseId1和warehouseId2这里是我的代码,但它不起作用.

select a.transporter, b.warehouseName as warehouse1, b.warehouseName as warehouse2
from transportation a, warehouse b
where a.warehouseId1 = b.warehouseId and a.warehouseId2 = b.warehouseId
Run Code Online (Sandbox Code Playgroud)

sql-server

1
推荐指数
1
解决办法
7749
查看次数

标签 统计

c# ×1

floating ×1

floating-point ×1

numbers ×1

parsing ×1

sql-server ×1