首页 > 编程知识 正文

c的发音,c语言入门自学

时间:2023-05-03 16:15:47 阅读:136545 作者:4308

c #三种四舍五入方法上取下四舍五入

Math.Round :四舍六入五取整

Math.Ceiling :向上舍入,以便有小数时加1

Math.Floor :在下面取整数,总是舍去小数

public intLongestShifttime (

{int longestShifttime=0; doublelongestshifttimeseconds=0; doublelongestshifttimesecondstemp=0;

DataSet ds=GetShiftStartEndList (; if(ds.Tables.count0) )。

//遍历开始时间列表的核对

foreach (datarowrowinds.tables [0].rows ) )。

{

datetimeshiftstarttime=datetime.parse exact (row [ ' shift start time ' ].tostring (,' HH:mm:ss ',cultureinfrinfring )

datetimeshiftendtime=datetime.parse exact (row [ ' shift end time ' ].tostring )、' HH:mm:ss '、cultureinfo.culture

timespand3=shift end time.subtract (shift start time );//判断是否需要追加一天

shiftstarttimeshiftendtime )。

{

longestshifttimesecondstemp=D3.total seconds 86400;

}else{

longestshifttimesecondstemp=D3.total seconds;

}长时间短时间码(if ) )。

{

longestshifttimeseconds=longestshifttimesecondstemp;

}

}

(if ) longestshifttimeseconds!=0)

{

longestshifttime=convert.toint 32 (math.ceiling ((longestshifttimeseconds/60 )/60 ) );

}returnlongestShifttime;

}

publicintlongestshifttime ((intlongestshifttime=0; doublelongestshifttimeseconds=0; doublelongestshifttimesecondstemp=0; DataSet ds=GetShiftStartEndList (;

if(ds.Tables.count0)//遍历开始时间列表为foreach (datarowrowinds.tables [0].rows ) datetimeshiftstarttime=datetime datetimeshiftendtime=datetime.parse exact (row [ ' shift end time ' ].tostring )、' HH:mm:ss '、cultureinfo.culture

timespand3=shift end time.subtract (shift start time );

//每天if (longestshifttimesecondstemp=D3.total seconds 86400; } else { longestshifttimesecondstemp=D3.total seconds; (if (longestshifttimesecondstemplongestshifttimeseconds ) longestshifttimeseconds=longestshifttimesecondstemp; }}if(longestshifttimeseconds!=0) longestshifttime=convert.toint 32 (math.ceiling ((longestshifttimeseconds/60 )/60 ) ); }

return longestShifttime; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。