ParseFloat() public static method

Attempt to parse a string representation of a float.
public static ParseFloat ( string value ) : float
value string
return float
Exemplo n.º 1
0
        public static float ReadSingle(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("float", reader);

            if (value is float)
            {
                return((float)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseFloat((string)value));
            }
            throw PrimitiveParser.CreateProtocolViolationException("float", value);
        }
Exemplo n.º 2
0
        public static float ReadSingle(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("float", reader);

            if (value is float)
            {
                return((float)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseFloat((string)value));
            }
            PrimitiveParser.InvalidConversion("float", value);
            return(0);
        }