我要将字符串值转换为双精度值...实际上我想使用TimeSpan
值将秒转换为分钟,我想转换的值为780.0000000656558
780 秒,其余为毫秒...我想显示13.00000000010942633333
或例如 13 分钟以防万一是没有准确的认知
我正在尝试使用以下代码
if (DownTime != null)
{
DownTime.Text = sensor.DownTime;
if (DownTime.Text.Length > 0)
{
//TimeSpan.FromSeconds(DownTime.Text).ToString()
double DownTimeSeconds = Convert.ToDecimal(DownTime.Text).ToString();
double DownTimeMints = DownTimeSeconds / 60;
sensor.DownTime = Convert.ToString(DownTimeMints);
DownTime.Text = sensor.DownTime;
DownTime.ToolTip = DownTime.Text;
if (DownTime.Text.Length >= 25)
{
DownTime.Text = DownTime.Text.Substring(0, 20) + "...";
}
}
}
我想在几分钟内显示输出......我应该怎么做提前致谢