tryParse static method

Decimal? tryParse(
  1. String source
)

Parses source as a decimal literal and returns its value as Decimal.

Implementation

static Decimal? tryParse(String source) {
  try {
    return Decimal.parse(source);
  } on FormatException {
    return null;
  }
}