예제 #1
0
        private void AdjustConstForType(ReferenceNode node, TypeInfo type)
        {
            DAGNode n = node;

            while (n is ReferenceNode)
            {
                n = n.NextNodes[0];
            }
            if (n is LeafNode && n.Data.Length > 0 && (char.IsDigit(n.Data[0]) || n.Data[0] == '.' || n.Data[0] == '-'))
            {
                long   v  = 0;
                double dv = 0.0;
                if (n.Data.IndexOf('.') >= 0)
                {
                    dv = ConstUtility.ParseDouble(n.Data);
                    v  = (long)dv;
                }
                else
                {
                    v  = ConstUtility.ParseLong(n.Data);
                    dv = (double)v;
                }
                n.Data = ConstUtility.ConstToString(type, v, dv);
            }
        }
예제 #2
0
 public string ConstToString(TypeInfo ti)
 {
     return(ConstUtility.ConstToString(ti, IntegerVal, FloatVal));
 }