/// <summary> /// 获取取大值 /// </summary> /// <param name="a">P1值</param> /// <param name="b">P2值</param> /// <param name="c">P3值</param> /// <returns>float</returns> public float GetMaxValue(string a, string b, string c) { if (string.IsNullOrEmpty(a)) { a = "0"; } if (string.IsNullOrEmpty(b)) { b = "0"; } if (string.IsNullOrEmpty(c)) { c = "0"; } float A = Convert.ToSingle(a); float B = Convert.ToSingle(b); float C = Convert.ToSingle(c); return (A > B) ? (A > C ? A : C) : (B > C ? B : C); } /// <summary> /// 获取取小值 /// </summary> /// <param name="a">P1值</param> /// <param name="b">P2值</param> /// <param name="c">P3值</param> /// <returns>float</returns> public float GetMinValue(string a, string b, string c) { if (string.IsNullOrEmpty(a)) { a = "0"; } if (string.IsNullOrEmpty(b)) { b = "0"; } if (string.IsNullOrEmpty(c)) { c = "0"; } float A = Convert.ToSingle(a); float B = Convert.ToSingle(b); float C = Convert.ToSingle(c); return (A < B) ? (A < C ? A : C) : (B < C ? B : C); }