toDoubleN static method

double? toDoubleN(
  1. dynamic d
)

Converts to nullable double

Implementation

static double? toDoubleN(dynamic d) {
  if (d is double) {
    return d;
  }
  if (d is int) {
    return d.toDouble();
  }
  if (d is String) {
    return double.tryParse(d);
  }
  return null;
}