PHPackages                             marzzelo/uconverter - 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. marzzelo/uconverter

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

marzzelo/uconverter
===================

Customizable Physical Unit Converter - Demo library - Please do not use it in production

1.0.5(3y ago)176MITPHP

Since May 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/marzzelo/uconverter)[ Packagist](https://packagist.org/packages/marzzelo/uconverter)[ RSS](/packages/marzzelo-uconverter/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

uconverter
==========

[](#uconverter)

[uconverter](https://github.com/marzzelo/uconverter) is a customizable units converter.

Install
-------

[](#install)

```
composer require marzzelo/uconverter

```

Usage
-----

[](#usage)

Instanciating a new units-converter:

```
$converter = new UnitsConverter([
		    'gf'  => 1000.0,
		    'N'   => 9.8066,
		    ...
		]);

```

(All quantities must be equivalent, ie.: 1000 gf == 9.8066 N).

Example: decaNewtons to kilograms:

```
print $converter->kgf(1, 'daN');  // 1.019721

```

Adding a new unit after construction:

```
$converter->lbf = 2.2046;

$converter->kgf(2.2046, 'klbf');  // 1000

```

### multiples &amp; submultiples

[](#multiples--submultiples)

Included prefixes:

```
                'da' => 10,
                'a'  => 1e-18,
                'f'  => 1e-15,
                'p'  => 1e-12,
                'n'  => 1e-9,
                'u'  => 1e-6,
                'm'  => 1e-3,
                'c'  => 0.01,
                'd'  => 0.1,
                'h'  => 100,
                'k'  => 1000,
                'M'  => 1e6,
                'G'  => 1e9,
                'T'  => 1e12,
                'P'  => 1e15,
                'E'  => 1e18,

```

Example (TeraNewtons to microNewtons):

```
$converter->uN(1.0, 'TN');  //  1.0e+18

```

### Using Included Converters

[](#using-included-converters)

To use included converters, use the static `UnitsConverter::getConverter()`.
'force', 'length' and 'pressure' converters are included.

```
$fconverter = UnitsConverter::getConverter('force');
$pconverter = UnitsConverter::getConverter('pressure');
$lconverter = UnitsConverter::getConverter('length');

print $fconverter->N(1, 'kgf');     // 9.806652048217
print $pconverter->Pa(1, 'MPa');    // 1e6
print $lconverter->cm(1, 'in');     // 2.5400000025908

```

Available built-in units
------------------------

[](#available-built-in-units)

### Force

[](#force)

*N, lbf, gf, ouncef, poundf, dyne, sthene*

and their multiples:

*daN, kN, klbf, kgf, kpoundf, etc.*

### Pressure

[](#pressure)

*psi, Pa, gmm2, bar, atm, mHg, inHg, inH2O, torr*

and their multiples:

*kPa, hPa, MPa, kgmm2, cmHg, mmHg, mbar, etc.*

### Length

[](#length)

*m, in, ft, hand, ly, mi, yd, pc, AU, Ao*

and their multiples:

*dm, cm, mm, um, dam, hm, km, ...*

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~125 days

Recently: every ~157 days

Total

6

Last Release

1223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cbf8091e16d7f14d27d78e827736b1252743cc1c28f03a2157d2e9204a5028dd?d=identicon)[marzzelo](/maintainers/marzzelo)

---

Top Contributors

[![marzzelo](https://avatars.githubusercontent.com/u/5240895?v=4)](https://github.com/marzzelo "marzzelo (18 commits)")

---

Tags

convertersunits-converter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marzzelo-uconverter/health.svg)

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

PHPackages © 2026

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