ankitjain28may/prettysize
Composer 安装命令:
composer require ankitjain28may/prettysize
包简介
Convert bytes to other sizes for prettier logging
关键字:
README 文档
README
prettysize was created by, and is maintained by Ankit Jain, and is a helper utility to provide pretty printed file sizes.
Installation & Usage
Requires PHP 7.1+
Require prettysize using Composer:
composer require ankitjain28may/prettysize
Arguments
Pretty::pretty($size, $nospace, $one, $places); /* $size : Size in bytes to be converted (Required) $nospace : Remove space from the output (Default - false) $one : Single character for the size (Default - false) $places : Number of decimal places to return (Default - 1) */
use Ankitjain28may\Prettysize\Pretty; $size = Pretty::pretty(1024); // $size = "1.0 kB" $size = Pretty::pretty(1024, true, true, 2); // $size = "1.00k" $size = Pretty::pretty(1024, ['nospace' => true, 'one' => true, 'places' => 5]); // $size = "1.00000k"
Contributing
Thank you for considering to contribute to prettysize. You can also follow the twitter account for latest announcements or just come say hi!: @ankitjain28may
License
prettysize is an open-sourced library licensed under the MIT license.
统计信息
- 总下载量: 114
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-24