[Solved] C# Linq query calculate percentage from integer [closed]
Convert the list to a decimal list, and use something like the following : var list = new List<decimal> { 2512793, 119176, 83599, 45613, 43352 }; decimal sum = list.Sum(); var perc = list.Select(x => (x / sum) * 100); Alternatively, you can cast each value as decimal. Or Alternatively as @James Pointed out there … Read more