prinsfrank / measurement-unit
A collection of measurement units for easy conversion
Fund package maintenance!
PrinsFrank
Installs: 8 284
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0
- prinsfrank/arithmetic-operations: ^0.1.0
- prinsfrank/arithmetic-operations-floating-point: ^0.1.2
- prinsfrank/arithmetic-operations-implementation: ^0.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.12
- phpstan/phpstan: ^1.9
- phpstan/phpstan-phpunit: ^1.2
- phpunit/phpunit: ^9.5
README

Measurement-unit
Setup
Note Make sure you are running PHP 8.1 or higher to use this package
To use this package in your project, run the following command:
composer require prinsfrank/measurement-unit
Provided units
Type | Available unit |
---|---|
Length | Fathom, Foot, Furlong, HorseLength, Inch, Meter, Kilometer, NauticalMile, StatuteMile, SurveyMile, Thou, Yard |
Speed | KilometerPerHour, Knot, MeterPerSecond, MilesPerHour |
Temperature | Celsius, Fahrenheit, Kelvin, Rankine |
Time | Day, Hour, Minute, Second |
Torque | NewtonMeter |
Volume | CubicInch, CubicMeter, CubicYard, FluidDram, FluidOunce, Liter, Pint, Quart, TableSpoon |
Weight | Kilogram, MetricTon, Pound |
All the units of a type can be converted to each other with corresponding methods.