C#二个整型相除的结果用百分比表示

double a = double.Parse("1");

  double b = double.Parse("5");

  string str = (a/b).ToString("0%"); //无小数位

  string str = (a/b).ToString("P");    //P表示二位小数0.00%

posted @ 2011-06-08 08:37  94cool  阅读(305)  评论(0)    收藏  举报