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

int a = 10;

int b = 100;

double percent = (double)a/b;

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

转载自https://blog.csdn.net/suncherrydream/article/details/12619031

猜你喜欢

转载自blog.csdn.net/qq_38225873/article/details/82948971