Example #1
0
        public static string zFormatForID(object Expression, int maxLengthB)
        {
            string str = "";

            try
            {
                str = ExCast.zCStr(Expression);
                if (string.IsNullOrEmpty(str))
                {
                    return("");
                }
                if (maxLengthB == 0)
                {
                    return("");
                }
                if (ExCast.IsNumeric(str) == false)
                {
                    return(str);
                }

                string str0 = "";
                for (int i = 1; i <= maxLengthB; i++)
                {
                    str0 += "0";
                }
                return(ExCast.zCDbl(str).ToString(str0));
            }
            catch
            {
                return(str);
            }
        }
Example #2
0
        public static string zNumZeroNothingFormat(object Expression)
        {
            string _id = "";

            try
            {
                _id = zCStr(Expression);
                if (ExCast.IsNumeric(_id))
                {
                    _id = ExCast.zCDbl(_id).ToString();
                }
            }
            catch
            {
                _id = zCStr(Expression);
            }

            return(_id);
        }