金额 格式化转换字符串

lblText.Text = string.Format("{0:C2}"12.345);            //¥12.35

       Object d 
= new Object();

       d 
= "12.345";

       lblText.Text 
= String.Format("{0:C2}", d);                  //12.345
       lblText.Text = String.Format("{0:C2}", d.ToString());       //12.345

       Object c 
= new Object();
       c 
= 12.345;
       lblText.Text 
= String.Format("{0:C2}", c);                 //¥12.35
       lblText.Text = String.Format("{0:C2}", c.ToString());      //12.345

posted on 2011-12-16 11:20  shine0210  阅读(358)  评论(0编辑  收藏  举报

导航