小数 向上 取整

                            var d1 = Convert.ToDateTime(list[0].BeginTime);
                            var d2 = Convert.ToDateTime(list[0].EndTime);
                            var difference = Time2TimeStamp(d2) - Time2TimeStamp(d1);
                            var housr = difference / 3600.0;
                            if (housr - (int)housr > 0)
                            {
                                housr = (int)housr + 1;
                            }

 

posted @ 2020-11-21 15:57  enych  阅读(354)  评论(0编辑  收藏  举报