toReadableBytes static method

Readable toReadableBytes(
  1. num? value, {
  2. ByteUnits unit = ByteUnits.auto,
})

Converts a numeric value to a human-readable byte format.

Example:

Readable readableBytes = Number.toReadableBytes(2048);
print(readableBytes); // Output: 2.00 KB

Implementation

static Readable toReadableBytes(
  num? value, {
  ByteUnits unit = ByteUnits.auto,
}) {
  return unit.read(value);
}