convertToDouble function

double convertToDouble(
  1. dynamic json
)

Implementation

double convertToDouble(dynamic json) {
  if (json is num) {
    return json.toDouble();
  }
  if (json is String) {
    return double.parse(json);
  }
  throw FormatException('Value cannot be converted to double: $json');
}