file_sizes 1.0.3 copy "file_sizes: ^1.0.3" to clipboard
file_sizes: ^1.0.3 copied to clipboard

outdated

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

FileSize #

pub package Dart

Get human readable file sizes in an easy way

Examples #

getSize(string or number, {PrecisionValue}): returns String

  • Direct Method Call
FileSize().getSize(1000)          \\ '1.00 KB'
FileSize().getSize(1048576)        \\ '1.04 MB'
FileSize().getSize(1073741824)      \\ '1.00 GB'
FileSize().getSize(1099511627776)    \\ '1.00 TB'
  • Method call with PrecisionValue [Optional]
FileSize().getSize(664365320, PrecisionValue.THREE)     \\ "633.588 MB"
FileSize().getSize(4324324232343, PrecisionValue.FOUR)   \\ "3.9321 TB"
  • Method call without decimal value
FileSize().getSize(664365320, PrecisionValue.NONE)     \\ "633 MB"
FileSize().getSize(4324324232343, PrecisionValue.NONE)   \\ "3 TB"

getKiloBytes(string or number, {PrecisionValue}): returns String

FileSize().getKiloBytes(54613)          \\ '54.61 KB'
27
likes
0
points
1.48k
downloads

Publisher

verified publisheranmolsethi.dev

Weekly Downloads

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on file_sizes