【发布时间】:2013-06-11 21:55:40
【问题描述】:
我想知道当一个值被截断时如何四舍五入到最接近的 100。 我正在使用这个:
private static int CalculatePaperLevel(int paperLevel)
{
int roundedLevel = 0;
roundedLevel = ((int)Math.Round(paperLevel / 10.0) * 10);
return roundedLevel;
}
但这就是我想要的
例如 191 -> 100
224 -> 200
140 -> 100
295 -> 200
【问题讨论】:
标签: c#