prinsfrank/measurement-unit

A collection of measurement units for easy conversion

Maintainers

Package info

github.com/PrinsFrank/measurement-unit

pkg:composer/prinsfrank/measurement-unit

Fund package maintenance!

PrinsFrank

Statistics

Installs: 9 081

Dependents: 0

Suggesters: 0

Stars: 11

Open Issues: 3

v1.5.0 2025-03-14 15:19 UTC

README

Banner

Measurement-unit

GitHub PHP Version Support codecov

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 Centimeter, Fathom, Foot, Furlong, HorseLength, Inch, Kilometer, Meter, Millimeter, NauticalMile, StatuteMile, SurveyMile, Thou, Yard
Pressure Bar, Hectopascal, Kilopascal, Millibar, MillimetreOfMercury, Pascal, PoundPerSquareInch, StandardAtmosphere, Torr
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.