toFixed static method

String toFixed(
  1. dynamic value, {
  2. int digits = 2,
  3. String def = "0",
})

toFixed

Implementation

static String toFixed(value, {int digits = 2, String def = "0"}) {
  if (value == null || value.toString().isEmpty) return def;
  return double.parse(value.toString()).toStringAsFixed(digits);
}