toMegaBytes function

String toMegaBytes(
  1. int bytes, {
  2. int fractionDigits = 2,
})

Convert bytes to megabytes

Implementation

String toMegaBytes(int bytes, {int fractionDigits = 2}) {
  return (bytes / (1024 * 1024)).toStringAsFixed(fractionDigits);
}