divide static method

String divide(
  1. String? value,
  2. double by, {
  3. int decimal = 2,
})

Divide Helper

Implementation

static String divide(
    String? value,
    double by, {
      int decimal = 2,
    }) {
  final v = double.tryParse(value ?? '');
  if (v == null || by == 0) return '';

  return format((v / by).toString(), decimal: decimal);
}