toDouble method

double toDouble()

Converts a String to an int.

Normally it parses, but if it cannot parse it, it creates a random string.

Implementation

double toDouble() {
  if (isEmpty) {
    return 0.0;
  }
  final d = double.tryParse(this);
  if (d != null) {
    return d;
  }
  double val = 0.0;
  for (final rune in runes) {
    val += (val + 1.0) * rune;
  }
  return val;
}