Rob*_*ert 0 c# floating-point double
我在数据库中有一个名为Profit的字段.在我的应用程序中我计算利润:
myFunds.Profit = float.Parse(Math.Round(myFunds.Profit.Value * myFunds.Stake / myFunds.Stake, 3, MidpointRounding.AwayFromZero).ToString());
Run Code Online (Sandbox Code Playgroud)
myFunds.Profit的类型是int?.Math.Round返回值为double并且正在转换为float.在数据库中,利润保存为5,40000009536743.我知道float的精度低于double.是否可能在小数点后七位之后减少数字?
谢谢
| 归档时间: |
|
| 查看次数: |
1636 次 |
| 最近记录: |