isimmons / weight-conversions
Weight conversions in PHP
Fund package maintenance!
isimmons
Requires
- php: ^8.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.21.1
- pestphp/pest: ^2.20
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-10-28 17:43:02 UTC
README
Convert any number of units in grams or kilograms to pounds or stones
Installation
You can install the package via composer:
composer require isimmons/weight-conversions
Basic Usage
use Isimmons\WeightConversions\Weight; include 'vendor/autoload.php'; $amount = 100; $pounds_from_grams = Weight::grams($amount)->toPounds(); $pounds_from_kilograms = Weight::kilograms($amount)->toPounds(); echo "$amount grams = $pounds_from_grams pounds." . PHP_EOL; echo "$amount kilograms = $pounds_from_kilograms pounds.\n" . PHP_EOL;
Available Methods
- toPounds
- toStones
Testing
composer test
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
License
The MIT License (MIT). Please see License File for more information.