Convert any number of units in grams or kilograms to pounds or stones
You can install the package via composer:
composer require isimmons/weight-conversions
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;
- toPounds
- toStones
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.