kOS.Safe.Encapsulation.ScalarValue.TryParseDouble C# (CSharp) Method

TryParseDouble() public static method

public static TryParseDouble ( string str, ScalarValue &result ) : bool
str string
result ScalarValue
return bool
        public static bool TryParseDouble(string str, out ScalarValue result)
        {
            result = null; // default the out value to null
            str = trimPattern.Replace(str, "E"); // remove white space around "e"
            double val;
            if (double.TryParse(str, out val))
            {
                // use Create instead of new ScalarDoubleValue so doubles that
                // represent integers will output a ScalarIntValue instead
                result = Create(val);
                return true;
            }
            return false;
        }