getNumByValueStr static method

num? getNumByValueStr(
  1. String valueStr, {
  2. int? fractionDigits,
})

The parameter fractionDigits must be an integer satisfying: 0 <= fractionDigits <= 20.

Implementation

static num? getNumByValueStr(String valueStr, {int? fractionDigits}) {
  double? value = double.tryParse(valueStr);
  return fractionDigits == null
      ? value
      : getNumByValueDouble(value, fractionDigits);
}