string overplusdays = (buymonth - nowtime).ToString();
Literal7.Text = overplusdays;
最后得到的
剩余天数:104.06:41:22.9218750正确的天数应该是 104.3天 
怎么格式化才行?

解决方案 »

  1.   

    试试如下:TimeSpan ts = buymonth - nowtime;
    Literal7.Text = ts.Days.ToString();
      

  2.   


    TimeSpan ts = buymonth - nowtime;
    Literal7.Text = ts.TotalDays.ToString();
      

  3.   

    hbxtlhx(平民百姓-自已动手,丰衣足食)可以了不好意思,给错分了,大分应该给你的,填错了,手误!!!!!!!
      

  4.   

    加了个.ToString("##,##0.0");就可以了!!!!!!