asFloat method

double? asFloat(
  1. String key, {
  2. String? section,
  3. double? defaultValue,
})

Returns a float value given by section and key. key: the key of the (key value) pair section: if given the (key value) pair is searched in this section defaultValue: if the key does not exists this value is returned

Implementation

double? asFloat(String key, {String? section, double? defaultValue}) {
  var rc = defaultValue;
  final value = asString(key,
      section: section,
      defaultValue: defaultValue == null ? null : defaultValue.toString());
  if (value != null) {
    rc = double.parse(value);
  }
  return rc;
}