clarkeash/converter

dev-master 2017-09-17 14:26 UTC

This package is auto-updated.

Last update: 2024-05-07 14:55:53 UTC


README

Convert metrics from one form to another.

68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636c61726b656173682f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f636c61726b656173682f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636c61726b656173682f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636c61726b656173682f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265 687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40636c61726b656173682d626c75652e7376673f7374796c653d666c61742d737175617265

Installation

composer require clarkeash/converter

Usage

Convert Memory Sizes

Convert::size()->of(500)->megabytes()->to()->gigabytes(); // 0.5
Convert::size()->of(2)->mebibytes()->to()->bytes(); // 2097152

See the Size class to see all the available conversion methods.

Convert Time

Convert::time()->from(3)->weeks()->to()->days(); // 21
Convert::time()->from(4)->scores()->and(7)->years()->into()->years(); // 87

See the Time class to see all the available conversion methods.