private List <string> GenerateFishReport(double totalValue, Dictionary <string, double> valuePerItemDict, double totalTimeInHours, string valueName, string valueUnitName) { List <String> report = new List <string>(); string valueNameCap = CommonPresenterStuff.CapitalizeFirstLetter(valueName); // sort items by value descending var valuePerItem = from fishMassPair in valuePerItemDict orderby fishMassPair.Value descending select fishMassPair; // generate report report.Add("Total " + valueName + ": " + totalValue.ToString("0.00") + " " + valueUnitName); report.Add(valueNameCap + " per fish:"); foreach (KeyValuePair <string, double> pair in valuePerItem) { string item = pair.Key; double value = pair.Value; double percentage = value / totalValue * 100; report.Add("\t" + String.Format("{0, -15}", item) + String.Format("{0, -15}", value.ToString("0.00") + " " + valueUnitName) + "(" + percentage.ToString("0.00") + "%)"); } report.Add(""); double valuePerHour = totalValue / totalTimeInHours; report.Add("Total average " + valueName + " per hour: " + valuePerHour.ToString("0.00") + " " + valueUnitName + "/h"); report.Add("Average " + valueName + " per hour per fish:"); foreach (KeyValuePair <string, double> pair in valuePerItem) { string item = pair.Key; double value = pair.Value; double averageValuePerHour = value / totalTimeInHours; report.Add("\t" + String.Format("{0, -15}", item) + averageValuePerHour.ToString("0.00") + " " + valueUnitName + "/h"); } return(report); }