PHPackages                             vansales/uconvert - 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. vansales/uconvert

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

vansales/uconvert
=================

PHP Library to convert product units

1.0(5y ago)035MITPHPPHP &gt;=7.2

Since Apr 18Pushed 5y ago1 watchersCompare

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

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

vansales/uconvert
=================

[](#vansalesuconvert)

[![Build Status](https://camo.githubusercontent.com/8b15e766379047886913d6877737b10f9c79fdba39cdbbdee5baeb8409a9a7ab/68747470733a2f2f7472617669732d63692e6f72672f76616e73616c65732f75636f6e766572742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vansales/uconvert)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)

PHP Library :: Unit Conversions for product packing

Requirement
-----------

[](#requirement)

- PHP 7.2+

Composer
--------

[](#composer)

This package available on [Packagist](https://packagist.org/packages/vansales/uconvert), Install the latest version with composer

```
composer require vansales/uconvert

```

Usage
-----

[](#usage)

```
$convert = new vansales\Uconvert;

// Initial set of Unit Conversion
$baseUnit = 'ชิ้น';

$convrtSet = array(
    'unit1' => 'แพ็ค',
    'unit2' => 'โหล',
    'unit3' => '',
    'conv1' => 6,
    'conv2' => 12,
    'conv3' => 0,
);

$convert->init($baseUnit, $convrtSet);

$convert->setQty(59);
$result = $convert->from_baseUnit();
print_r($result);

$convert->setQty(15);
$convert->setUnit('ลัง');
$result = $convert->to_baseUnit();
print_r($result);
```

Contributing
------------

[](#contributing)

Feel free to contribute on this project, We'll be happy to work with you.

License
-------

[](#license)

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1893d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21befba7b465de51a10ef406d41b364da5c8ed638fc481e71e080077a3de3700?d=identicon)[monthon.n](/maintainers/monthon.n)

---

Top Contributors

[![jaycreate](https://avatars.githubusercontent.com/u/1081275?v=4)](https://github.com/jaycreate "jaycreate (3 commits)")

---

Tags

unit-conversionunit-of-measurement

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vansales-uconvert/health.svg)

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

###  Alternatives

[yucca/prerender-bundle

Allows you to easily use prerender for your Symfony apps running Client-Side MVC

5617.1k](/packages/yucca-prerender-bundle)

PHPackages © 2026

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