convertToDouble method

double convertToDouble(
  1. String? value
)

Implementation

double convertToDouble(String? value) {
  try {
    if (value != null) {
      String _onlyDigits = value.replaceAll(
        RegExp('[^0-9]'),
        "",
      );

      return double.parse(_onlyDigits) / 100;
    } else {
      return 0.0;
    }
  } catch (e) {
    return 0.0;
  }
}