tryToNum method

num? tryToNum()

Attempts toNum, returning null when parsing fails.

Implementation

num? tryToNum() {
  try {
    return toNum();
  } catch (_) {
    return null;
  }
}