我有这段代码:
Double secsSinceLastCheck = AS.pointsDate - DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
Int32 prt = AS.prt.Val();
var reducePoints = secsSinceLastCheck / prt;
我想要的是reducePoints是一个从等式右边的值向下舍入的整数。
答案 0 :(得分:1)
试试这个
int reducePoints = Convert.ToInt32(Math.Floor(secsSinceLastCheck / Convert.ToDouble(prt)));