An open API service indexing awesome lists of open source software.

https://github.com/prinsfrank/measurement-unit

A collection of measurement units for easy conversion and typed code (Weight, Volume, Length, Time, Speed & more!)
https://github.com/prinsfrank/measurement-unit

hacktoberfest php speed time torque volume weight

Last synced: about 1 year ago
JSON representation

A collection of measurement units for easy conversion and typed code (Weight, Volume, Length, Time, Speed & more!)

Awesome Lists containing this project

README

          


Banner

# Measurement-unit

![GitHub](https://img.shields.io/github/license/prinsfrank/measurement-unit)
![PHP Version Support](https://img.shields.io/packagist/php-v/prinsfrank/measurement-unit)
[![codecov](https://codecov.io/gh/PrinsFrank/measurement-unit/branch/main/graph/badge.svg?token=9O3VB563MU)](https://codecov.io/gh/PrinsFrank/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:

```shell
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.