C#两整数相除获得百分数

nt a = 12;

int b = 130;

double percent = (double)a/b;

string percentText = percent.ToString("0.0%");//最后percentText的值为10.0%

你可能感兴趣的