Rad*_*ani -1 c# vb.net math rounding
我的数据是10.17,我希望得到10.50.这个代码我用过totQty = Math.Round(totQty, 1, MidpointRounding.ToEven)但得到10.20.
totQty = Math.Round(totQty, 1, MidpointRounding.ToEven)
msi*_*itt 6
为此,您可以将数字乘以2,向上舍入为0小数,然后将其除以2.
double rounded = Math.Ceiling(2 * value) / 2;
归档时间:
8 年,6 月 前
查看次数:
138 次
最近记录: