double cost1;//定以每小时的上机费用
cost1=atof(m_set3.m_hour_price1);//m-set3.m-hour-price1是存在数据哭里的每小时单价CTimeSpan t1(m_set2.m_first_time.GetDay(),m_set2.m_first_time.GetHour(),m_set2.m_first_time.GetMinute(),m_set2.m_first_time.GetSecond());
st1[count]=t1; CTimeSpan t2(m_set2.m_end_time.GetDay(),m_set2.m_end_time.GetHour(),m_set2.m_end_time.GetMinute(),m_set2.m_end_time.GetSecond());
CTimeSpan totaltime;
st2[count]=t2; totaltime=st2[count]-st1[count];//得到上机的总时间
//下面开始计算上机费用,每小时价格/3600*总的秒数=上机费用
Spendmoney=totaltime.GetTotalSeconds()*cost1/3600;
//但是为什么在列表里价钱显示总是零了?
tmp_str.Format("%f",Spendmoney);
m_list1.SetItemText(select_id,6,tmp_str); //上机时间可以正确显示
tmp_str=totaltime.Format("%H:%M:%S");
m_list1.SetItemText(select_id,5,tmp_str);
解决方案 »
- 关于VC程序打包的问题!
- 采用CCITT G4 压缩的TIF黑白图,怎么确定其解压后0与1表示的颜色?
- 请教,那些用VC写出来的纯绿色软件是怎么做到的?
- 请问哪里有有关VC++界面编程的培训教程(最好是powerpoint),最多可直接给300分重谢!
- 请问有谁知道有关<<Windows程序设计>>的QQ群????
- 串口的疑惑????????????
- 关于edit 的过滤
- 关于动态数组的问题????
- 如何在程序中动态改变 CComboBox 的宽度
- vc和C++ Builder在开发方式上有什么不同!
- 在CListCtrl的LVIS_ICON方式下,如何使得icon和label的宽度相等?
- 有这样一个问题,大家指教下!
看看Spendmoney = totaltime......
执行过后Spendmoney的值是多少?
//cost1=atof(m_set3.m_hour_price1);//m-set3.m-hour-price1是存在数据哭里的每小时单价 CTime first(2003, 5, 7, 10 , 0 ,0);
CTime end(2003, 5, 7, 12, 25, 0); CTimeSpan t1(first.GetDay(),first.GetHour(),first.GetMinute(),first.GetSecond());
CTimeSpan t2(end.GetDay(),end.GetHour(),end.GetMinute(),end.GetSecond());
CTimeSpan totaltime;
CString tmp_str; totaltime=t2 - t1;//得到上机的总时间
//下面开始计算上机费用,每小时价格/3600*总的秒数=上机费用
double Spendmoney=totaltime.GetTotalSeconds()*cost1/3600;
//但是为什么在列表里价钱显示总是零了?
tmp_str.Format("%f",Spendmoney);
MessageBox(tmp_str); //上机时间可以正确显示
tmp_str=totaltime.Format("%H:%M:%S");
MessageBox(tmp_str);