小编Moh*_*med的帖子

C# Round to list values

I'm trying to round a result value to the next number in a list.

If the value is (187) I need to set the result to (240)

int[] list = new int[] { 16, 25, 35, 50, 70, 95, 120, 150, 185, 240, 300, 400 };
double max;
max = list.Where(x => x <= result).Max();
Run Code Online (Sandbox Code Playgroud)

But this does not work.

.net c# rounding

2
推荐指数
1
解决办法
107
查看次数

标签 统计

.net ×1

c# ×1

rounding ×1