fileSizeFormat 

Returns the given file size (in bytes) as a human-readable string.
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
bytes | number | ● | – |
| Converts it to a human-friendly string via the bytes provided here. | |||
decimals![]() named | number | – | 2 |
| Specifies the number of decimal places to represent. | |||
ceil![]() named | boolean | – | false |
If this value is true, the decimal point is removed and the number is rounded up. | |||

named parameters are passed as named parameters in Dart and keyword arguments in Python.
Returns
string
Examples
javascript
fileSizeFormat(1000000); // '976.56 KB'
fileSizeFormat(100000000, 3); // '95.367 MB'
fileSizeFormat(100000000, 0, true); // '96 MB'dart
fileSizeFormat(1000000); // '976.56 KB'
fileSizeFormat(100000000, decimals: 3); // '95.367 MB'
fileSizeFormat(100000000, ceil: true); // '96 MB'python
fileSizeFormat(1000000) # '976.56 KB'
fileSizeFormat(100000000, 3) # '95.367 MB'
fileSizeFormat(100000000, 0, True) # '96 MB'