本文介绍了如何操作分钟小时和费率以获得总金额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我总共有小时,分钟和费率,所以我怎样才能获得总金额
i尝试了一些代码,但结果不同于计算器;
受保护 double ConvertTo100( string strTemp)
{
strTemp = strTemp.Replace(' :', ' 。');
double dblTemp;
dblTemp = Convert.ToDouble(strTemp);
double dblHH = Math.Floor(dblTemp);
double dblMM = Math.Round(dblTemp - Math.Floor(dblTemp), 2 ) * 60 / 100 ;
double dboReturn;
dboReturn = dblHH + dblMM;
return dboReturn;
}
比我使用这个功能类似..
DGTotalMoney.DigitText = Convert.ToString(ConvertTo100(DGHours) .DigitText + : + DGMinutes.DigitText)*( double .Parse(CBlistPrice.Text)));
我也试过这段代码:
DGTotalMoney.DigitText = Convert.ToString(ConvertTo100(DGHours.DigitText + : + DGMinutes.DigitText)*( double .Parse(CBlistPrice.Text)));
但结果是deferent?
所以我需要帮助
解决方案
i have total of hours and minutes and rate , so how can i get totalmoney
i tryied some codes but the result is deferent to calculator;
protected double ConvertTo100(string strTemp) { strTemp = strTemp.Replace(':', '.'); double dblTemp; dblTemp = Convert.ToDouble(strTemp); double dblHH = Math.Floor(dblTemp); double dblMM = Math.Round(dblTemp - Math.Floor(dblTemp), 2) * 60 / 100; double dboReturn; dboReturn = dblHH + dblMM; return dboReturn; } than i use this funcation like.. DGTotalMoney.DigitText = Convert.ToString( ConvertTo100(DGHours.DigitText + ":" + DGMinutes.DigitText) * (double.Parse(CBlistPrice.Text)));
and i tried this code too:
DGTotalMoney.DigitText = Convert.ToString( ConvertTo100(DGHours.DigitText + ":" + DGMinutes.DigitText) * (double.Parse(CBlistPrice.Text)));
but the result is deferent?
so i need help
解决方案
这篇关于如何操作分钟小时和费率以获得总金额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!