clarkeash/converter

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

This package is auto-updated.

Last update: 2024-11-07 16:06:37 UTC


README

Convert metrics from one form to another.

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.