예제 #1
0
파일: Mathx.cs 프로젝트: dmgfhc/NGHB
        // Methods
        //十进转62进制 0-9,A-Z,a-z
        //
        public static string Convert10To62Metric(long value)
        {
            string str  = "";
            long   num  = value;
            int    num2 = System.Convert.ToInt32(Math.Log(value, 62));
            int    i    = num2;

            while (i >= 0)
            {
                long num4 = System.Convert.ToInt32(Math.Pow(62, i));
                int  num5 = System.Convert.ToInt32(num / num4);
                num = num - (num5 * num4);
                str = (string)(str + Mathx.NumToChar62(num5));
                i--;
            }
            return(str);
        }
예제 #2
0
파일: Mathx.cs 프로젝트: dmgfhc/NGHB
        public static double averageDouble(FarPoint.Win.Spread.FpSpread ss, int irow, int icol1, int icol2, int scale)
        {
            double avg   = 0;
            int    count = 0;

            for (int i = icol1; i <= icol2; i++)
            {
                if (ss.Sheets[0].Cells.Get(irow, i).Text != "")
                {
                    if (double.Parse((string)(ss.Sheets[0].Cells.Get(irow, i).Text)) != 0)
                    {
                        count++;
                        avg += double.Parse(ss.Sheets[0].Cells.Get(irow, i).Text);
                    }
                }
            }
            if (count != 0)
            {
                avg = (double)(Mathx.Roundx((decimal)(avg / count), scale, 1));
            }

            return(avg);
        }