PHPackages                             becker/conversion - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. becker/conversion

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

becker/conversion
=================

Laravel Unit Conversion

v1.0.3(6y ago)1281MITPHPPHP ^7.1

Since Jan 3Pushed 6y agoCompare

[ Source](https://github.com/becker/conversion)[ Packagist](https://packagist.org/packages/becker/conversion)[ Docs](https://github.com/becker/conversion)[ RSS](/packages/becker-conversion/feed)WikiDiscussions stable Synced today

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Laravel Unit Conversion
-----------------------

[](#laravel-unit-conversion)

This package helps to convert units. It was forked from [abhimanyu003/conversion](https://github.com/abhimanyu003/conversion) repository.

### Units supported

[](#units-supported)

- Acceleration
- Angle
- Area
- Storage
- Current
- Fuel
- Length
- Mass
- Pressure
- Speed
- Temperature
- Time
- Voltage
- Volume

### Installation

[](#installation)

```
composer require becker/conversion
```

### Register the Service Provider

[](#register-the-service-provider)

> **NOTE:** You can skip this step if you are using Laravel 5.5 or higher. The package is automatically registered, due to the [package discovery](https://laravel.com/docs/master/packages#package-discovery) feature.

Open up the `config/app.php` and register the new Service Provider:

```
//config/app.php

/*
 * Package Service Providers...
 */

Becker\Conversion\ConversionServiceProvider::class

//...
```

You can also register the Alias:

```
'Conversion'  => Becker\Conversion\Facades\Conversion::class
```

### How to use

[](#how-to-use)

```
Conversion::convert($value, 'type')->to('another_type');
```

#### Example:

[](#example)

- Converting MB to KB

```
Conversion::convert(1, 'megabyte')->to('kilobyte');
// 1.024,00 (two decimal places)
```

- Converting mm to cm

```
Conversion::convert(1000, 'millimeter')->to('centimeter');
```

- Converting kg to g

```
Conversion::convert(1, 'kilogram')->to('gram');
```

### Formatting results:

[](#formatting-results)

```
Conversion::convert($value, 'type')->to('another_type')
->format(int decimal, 'decimal place modifier', 'thousand place modifier');
```

#### Example:

[](#example-1)

```
Conversion::convert(1, 'megabyte')->to('kilobyte')->format(0,'.',',');
// 1,024 (no decimal place)
```

### Conversion Chart

[](#conversion-chart)

#### Acceleration

[](#acceleration)

- METRE\_PER\_SECOND\_SQUARE

#### Angle

[](#angle)

- TURN
- RADIAN
- DEGREE
- GRADIAN

#### Area

[](#area)

- SQUARE\_METER
- HECTARE
- SQUARE\_KILOMETER
- SQUARE\_INCH
- SQUARE\_FEET
- SQUARE\_YARD
- ACRE
- SQUARE\_MILE

#### Storage

[](#storage)

- BIT
- BYTE
- KILOBIT
- KILOBYTE
- MEGABIT
- MEGABYTE
- GIGABIT
- GIGABYTE
- TERABIT
- TERABYTE
- PETABIT
- PETABYTE

#### Current

[](#current)

- STATAMPERE
- MICROAMPERE
- MILLIAMPERE
- AMPERE
- ABAMPERE
- KILOAMPERE

#### Fuel

[](#fuel)

- KILOMETERS\_PER\_LITRE
- LITRE\_PER\_100\_KILOMETER
- MILES\_PER\_GALLON
- US\_MILES\_PER\_GALLON

#### Length

[](#length)

- MILLIMETER
- CENTIMETER
- METER
- KILOMETER
- INCH
- FOOT
- YARD
- MILE
- NAUTICAL\_MILE

#### Mass

[](#mass)

- MICROGRAM
- MILLIGRAM
- GRAM
- KILOGRAM
- METRIC\_TON
- OUNCE
- POUND
- STONE
- SHORT\_TON
- LONG\_TON

#### Pressure

[](#pressure)

- PASCAL
- KILOPASCAL
- MEGAPASCAL
- BAR
- MILLIMETERS\_OF\_MERCURY
- INCHES\_OF\_MERCURY
- POUNDS\_PER\_SQUARE\_INCH
- ATMOSPHERE

#### Speed

[](#speed)

- METER\_PER\_SECOND
- KILOMETERS\_PER\_HOUR
- FEET\_PER\_SECOND
- MILES\_PER\_HOUR
- KNOT

#### Temperature

[](#temperature)

- CELSIUS
- FAHRENHEIT
- KELVIN

#### Time

[](#time)

- NANOSECOND
- MICROSECOND
- MILLISECOND
- SECOND
- MINUTE
- HOUR
- DAY
- WEEK
- MONTH
- YEAR
- DECADE
- CENTURY
- MILLENIUM

#### Voltage

[](#voltage)

- VOLT
- KILOVOLT

#### Volume

[](#volume)

- MILLILITRE
- LITRE
- CUBIC\_METER
- GALLON
- QUART
- PINT
- TABLESPOON
- TEASPOON
- US\_GALLON
- US\_QUART
- US\_PINT
- US\_CUP
- US\_OUNCE
- US\_TABLESPOON
- US\_TEASPOON
- CUBIC\_INCH
- CUBIC\_FOOT

### Contribute

[](#contribute)

Feel free to contribute and update the repository.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98e58200ec3834174d70c29b27ea6f27b21ecad7955837673103eaf7f561c16c?d=identicon)[becker](/maintainers/becker)

---

Top Contributors

[![abhimanyu003](https://avatars.githubusercontent.com/u/265913?v=4)](https://github.com/abhimanyu003 "abhimanyu003 (23 commits)")[![becker](https://avatars.githubusercontent.com/u/376314?v=4)](https://github.com/becker "becker (12 commits)")[![mpash](https://avatars.githubusercontent.com/u/48454220?v=4)](https://github.com/mpash "mpash (2 commits)")[![RandyBooth](https://avatars.githubusercontent.com/u/782262?v=4)](https://github.com/RandyBooth "RandyBooth (1 commits)")[![drmonkeyninja](https://avatars.githubusercontent.com/u/357623?v=4)](https://github.com/drmonkeyninja "drmonkeyninja (1 commits)")[![blueclock](https://avatars.githubusercontent.com/u/586174?v=4)](https://github.com/blueclock "blueclock (1 commits)")[![marcioAlmada](https://avatars.githubusercontent.com/u/227395?v=4)](https://github.com/marcioAlmada "marcioAlmada (1 commits)")

---

Tags

unitlaravelconversionmeasurements

### Embed Badge

![Health badge](/badges/becker-conversion/health.svg)

```
[![Health](https://phpackages.com/badges/becker-conversion/health.svg)](https://phpackages.com/packages/becker-conversion)
```

###  Alternatives

[php-units-of-measure/php-units-of-measure

A PHP library for converting between standard units of measure.

3143.8M36](/packages/php-units-of-measure-php-units-of-measure)[php-unit-conversion/php-unit-conversion

A fully PSR-4 compatible PHP library for converting between standard units of measure.

691.2M2](/packages/php-unit-conversion-php-unit-conversion)[cartalyst/converter

A framework agnostic measurement conversion and formatting package featuring multiple types of measurements and currency conversion.

91488.9k7](/packages/cartalyst-converter)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

108168.0k](/packages/whitecube-laravel-timezones)[danielme85/laravel-cconverter

Laravel 5 plug-in for currency conversion

42102.7k](/packages/danielme85-laravel-cconverter)[nmarfurt/measurements

A PHP library for representing and converting dimensional units of measure.

17183.8k1](/packages/nmarfurt-measurements)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
