toDouble method

double? toDouble({
  1. bool nullOnError = false,
})

Transform string to double type

Implementation

double? toDouble({bool nullOnError = false}) {
  double? d = double.tryParse(this);
  if (d != null) return d;
  if (nullOnError) return null;
  throw FormatException('Can only acception double value');
}