public double normalMarkC(string markCC, string markTX, string markThi) { Comm.CommonLib com = new Comm.CommonLib(); double mThi, mTX, mCC; mThi = com.convert2Double(markThi, 0); mTX = com.convert2Double(markTX, 0); mCC = com.convert2Double(markCC, 0); string u = markThi.ToUpper(); if (com.checkDecimal(u) != 0) { return(0); } if (markCC == "" && markTX == "") { return(mThi); } double t = 0; if (mThi < 4) { return(mThi); } else { return(Math.Truncate((mCC + 2 * mTX + 7 * mThi) + 0.5) / 10); } }
public string normalMark(string markCC, string markTX, string markThi) { Comm.CommonLib com = new Comm.CommonLib(); string u = markThi.ToUpper(); if (com.checkDecimal(u) != 0) { return(""); } if (markCC == "" && markTX == "") { return(markThi); } double mThi, mTX, mCC; mThi = com.convert2Double(markThi, 0); mTX = com.convert2Double(markTX, 0); mCC = com.convert2Double(markCC, 0); double t = 0; if (mThi < 4) { return(markThi); } else { t = Math.Truncate(mCC + 2 * mTX + 7 * mThi + 0.5) / 10; } string kq = t.ToString("#0.0"); //if (kq[0] == '0') //{ // kq = kq.Remove(0, 1); //} return(kq); }