kparseNum method

num kparseNum({
  1. int digits = 0,
  2. num defValue = 0,
})

将数字字符串转num,数字保留x位小数

Implementation

num kparseNum({int digits = 0, num defValue = 0}) {
  var value = double.tryParse(this ?? "");
  return value.kformat(digits: digits, defValue: defValue);
}