Download the PHP package simbiat/cute-bytes without Composer
On this page you can find all versions of the php package simbiat/cute-bytes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package cute-bytes
CuteBytes
Class to present bytes (numeric value) as a human-readable string. There are several reasons you would want to use this library and not the common one-liner (or 3-liner) approach:
- No missing postfixes in case of too big or too small values.
- No superfluous trailing zeros.
- Follows SI format by default (power of 10, can be switched to power of 2, if so desired).
- Shows thousands by default (adjustable) for extra readability in some cases.
How to use
Easy:
will output 1,234.57 MB
You can change decimal and thousands delimiters or change number of decimals (precision)
to get 1.234,568 MB
If you want to drop thousands, set the default number of numbers shown
to get 1.23 GB
If you want to use "classic" logic (binary, power of 2) use
to get 1,177.38 MB
(note some additional loss of precision)
All versions of cute-bytes with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
The package simbiat/cute-bytes contains the following files
Loading the files please wait ....