convertDouble function

double? convertDouble(
  1. dynamic src
)

Implementation

double? convertDouble(var src) {
  if (src == null) return null;
  if (src is double) return src;
  if (src is int) return src.toDouble();
  if (src is String) return double.parse(src);
  throw Exception("Not double");
}