public double GetParamDiff(ArrowData.Param param) { double highest = 0; double lowest = 1000000.0; double mod = 1.0; foreach (var a in arrowList) { if (a.GetParam(param) > highest) { highest = a.GetParam(param); } if (a.GetParam(param) < lowest) { lowest = a.GetParam(param); } } if (param == ArrowData.Param.Grams) { mod = 10.0; } return(Math.Ceiling((highest - lowest) / 2.0 * mod) / mod); }
public string GetParamSummary(ArrowData.Param param) { switch (param) { case ArrowData.Param.ASTM: return("± " + (GetParamDiff(param) / GetAvgSpineASTM() * 100).ToString(GetStringFormatingForParam(param)) + "%"); default: return("± " + GetParamDiff(param).ToString(GetStringFormatingForParam(param))); } }
private string GetStringFormatingForParam(ArrowData.Param param) { switch (param) { case ArrowData.Param.Grams: return(Weight.GramFormat); case ArrowData.Param.GPI: return("0.0"); case ArrowData.Param.Straightness: return(Straightness.Format); case ArrowData.Param.Grains: case ArrowData.Param.ASTM: case ArrowData.Param.AMO: default: return("0"); } }