Ejemplo n.º 1
0
        public static bool ReadFloat(Characters source, int width, int d, out float destination)
        {
            string numberStg = source.Substring(1, width).ToString();
            float internalValue;
            bool isOK = float.TryParse(numberStg, out internalValue);

            destination = internalValue;

            if (numberStg.Contains(".") == false)
            {
                destination *= (float)Math.Pow(10, -d);
            }
            return isOK;
        }
Ejemplo n.º 2
0
        public static bool ReadFloat(Characters source, int width, int d, out float destination)
        {
            string numberStg = source.Substring(1, width).ToString();
            float  internalValue;
            bool   isOK = float.TryParse(numberStg, out internalValue);

            destination = internalValue;

            if (numberStg.Contains(".") == false)
            {
                destination *= (float)Math.Pow(10, -d);
            }
            return(isOK);
        }