Skip to content

Instantly share code, notes, and snippets.

View samtuga1's full-sized avatar
:octocat:
Available

Samuel Twumasi samtuga1

:octocat:
Available
View GitHub Profile
@samtuga1
samtuga1 / filesize.dart
Created June 24, 2024 14:42
A method returns a human readable string representing a file _size
/// A method returns a human readable string representing a file _size
String filesize(dynamic size, [int round = 2]) {
/**
* [size] can be passed as number or as string
*
* the optional parameter [round] specifies the number
* of digits after comma/point (default is 2)
*/
var divider = 1024;
int _size;