parse static method

num? parse(
  1. String text
)

Parses a formatted string back to a numeric value.

Implementation

static num? parse(String text) {
  if (text.isEmpty) return null;
  final clean = text.replaceAll(',', '');
  return num.tryParse(clean);
}