Download the PHP package jacobfitzp/weight-conversions without Composer
On this page you can find all versions of the php package jacobfitzp/weight-conversions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jacobfitzp/weight-conversions
More information about jacobfitzp/weight-conversions
Files in jacobfitzp/weight-conversions
Package weight-conversions
Short Description This is my package weight-conversions
License MIT
Homepage https://github.com/jacobfitzp/weight-conversions
Informations about the package weight-conversions
PHP Weight Conversions
Simple PHP package to convert between different units of weight measurement.
Supports gram, kilogram, milligram, ounce, pound, stone and ton... and can easily be extended to add additional units.
Installation
You can install the package via composer:
Usage
Extending
You can create your own units of measurement by extending the AbstractUnit class:
Let's break down how this works... The main thing to be aware of is the RELATIVE_TO_KG constant, this represents the amount of the unit that is relative to 1kg - For exampe, above we are saying that 50 hobnobs = 1kg. This is used as the basis for all conversion calculations.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Jacob Fitzpatrick
- All Contributors
License
The MIT License (MIT). Please see License File for more information.