Exemplo n.º 1
0
        static public float SafeTextToFloat(string text)
        {
            float res;

            if (float.TryParse(text, out res))
            {
                return(res);
            }
            ExtLog.AddLine("Failed to convert value: " + text);
            return(0.0f);
        }
Exemplo n.º 2
0
        static public int SafeTextToInt(string text)
        {
            int res;

            if (int.TryParse(text, out res))
            {
                return(res);
            }
            ExtLog.AddLine("Failed to convert value: " + text);
            return(0);
        }