public static MantissaRoundEnum ChangeValueToMantissaRoundEnum(int ValueID) { MantissaRoundEnum ReturnMantissaRoundEnum; switch (ValueID) { case 0: ReturnMantissaRoundEnum = new MantissaRoundEnum(0, "不处理"); break; case 1: ReturnMantissaRoundEnum = new MantissaRoundEnum(1, "见分进角"); break; case 2: ReturnMantissaRoundEnum = new MantissaRoundEnum(2, "见角进元"); break; case 3: ReturnMantissaRoundEnum = new MantissaRoundEnum(3, "四舍五入进分"); break; case 4: ReturnMantissaRoundEnum = new MantissaRoundEnum(4, "四舍五入进角"); break; case 5: ReturnMantissaRoundEnum = new MantissaRoundEnum(5, "四舍五入进元"); break; case 6: ReturnMantissaRoundEnum = new MantissaRoundEnum(6, "去分"); break; case 7: ReturnMantissaRoundEnum = new MantissaRoundEnum(7, "不计角分"); break; default: ReturnMantissaRoundEnum = new MantissaRoundEnum(-1, "全部"); break; } return(ReturnMantissaRoundEnum); }
/// <summary> /// 设置尾数处理函数 /// </summary> /// <param name="formula"></param> /// <param name="mantissaRound"></param> /// <returns></returns> public static string MantissaRoundDeal(string formula, MantissaRoundEnum mantissaRound) { return(MantissaRoundEnum.ChangeMantissaRoundEnumToFunctionName(mantissaRound.Id) + "(" + formula + ")"); }