/// <summary> /// Converts map element into a float or returns default value if conversion is not possible. /// </summary> /// <param name="key">a key of element to get.</param> /// <param name="defaultValue">the default value</param> /// <returns>float value of the element or default value if conversion is not supported.</returns> /// See <see cref="FloatConverter.ToFloatWithDefault(object, float)"/> public float GetAsFloatWithDefault(string key, float defaultValue) { var value = Get(key); return(FloatConverter.ToFloatWithDefault(value, defaultValue)); }
/// <summary> /// Converts array element into a float or returns default value if conversion is not possible. /// </summary> /// <param name="index">an index of element to get.</param> /// <param name="defaultValue">the default value</param> /// <returns>float value of element or default value if conversion is not supported.</returns> /// See <see cref="FloatConverter.ToFloatWithDefault(object, float)"/> public float GetAsFloatWithDefault(int index, float defaultValue) { return(FloatConverter.ToFloatWithDefault(this[index], defaultValue)); }
public float GetAsFloatWithDefault(float defaultValue) { return(FloatConverter.ToFloatWithDefault(Value, defaultValue)); }