prinsfrank/measurement-unit

A collection of measurement units for easy conversion

v1.2.0 2023-10-26 08:18 UTC

This package is auto-updated.

Last update: 2024-03-26 09:14:17 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 Fathom, Foot, Furlong, HorseLength, Inch, Meter, Kilometer, NauticalMile, StatuteMile, SurveyMile, Thou, Yard
Speed KilometerPerHour, 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.