getApiDoubleOrDefault method
double?
getApiDoubleOrDefault(
- K key, {
- double? defaultValue,
- List<K> alternativeKeys = const [],
- bool smartRound = false,
- int maxPrecision = 2,
})
Implementation
double? getApiDoubleOrDefault(
K key, {
double? defaultValue,
List<K> alternativeKeys = const [],
bool smartRound = false,
int maxPrecision = 2,
}) {
final parsed = _parseDouble(_valueFor(key, alternativeKeys), defaultValue);
if (parsed == null) return defaultValue;
if (!smartRound) return parsed;
return parsed.toNumAsSmartRound(maxPrecision: maxPrecision).toDouble();
}