checkDoubleN static method

double checkDoubleN(
  1. dynamic input,
  2. double fallback
)

Implementation

static double checkDoubleN(dynamic input, double fallback) {
  switch (input.runtimeType) {
    case String:
      return double.tryParse(input) ?? fallback;
    case int:
      return input + .0;
    case double:
      return input;
    default:
      return fallback;
  }
}