예제 #1
0
        /// <summary>
        /// Retrieves a float value from the specified path in the configuration.
        /// </summary>
        /// <param name="path">The path that contains the value to retrieve.</param>
        /// <param name="default">The default value to return if the value doesn't exist.</param>
        /// <exception cref="InvalidOperationException">This exception is thrown if the current node is undefined.</exception>
        /// <returns>The float value defined in the specified path.</returns>
        public virtual float GetFloat(string path, float @default = 0)
        {
            HoconValue value = GetNode(path);

            if (value == null)
            {
                return(@default);
            }

            return(value.GetFloat());
        }
 public static object ParseFloat(HoconValue e)
 {
     return(e.GetFloat());
 }