PHPackages                             burobo/ukon - 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. burobo/ukon

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

burobo/ukon
===========

Unit conversion library.

v1.0.0(6y ago)06MITPHPPHP &gt;=7.1CI failing

Since Aug 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/burobo/ukon-php)[ Packagist](https://packagist.org/packages/burobo/ukon)[ RSS](/packages/burobo-ukon/feed)WikiDiscussions master Synced 2d ago

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

Ukon
====

[](#ukon)

Ukon is a unit conversion calculator library. You can make your own unit conversion settings easily with it.

Installation
============

[](#installation)

```
composer require burobo/ukon

```

Usage
=====

[](#usage)

1. Create your own Unit class.

    ```
    use Ukon\Unit;

    class Metre extends Unit
    {
        /**
         * @inheritDoc
         */
        protected function languageSpecificFormats(): array
        {
            return [
                'default' => '%s metre',
            ];
        }

        /**
         * @inheritDoc
         */
        protected function globalFormats(): array
        {
            return [
                'abbr' => '%sm',
            ];
        }

        /**
         * @inheritDoc
         */
        protected function domain(): string
        {
            return 'messages';
        }
    }
    ```
2. Create your own Type class.

    ```
    use Ukon\Type;

    class Length extends Type
    {
        /**
         * @inheritDoc�
         */
        public function __construct(int $scale)
        {
            parent::__construct($scale);
            $this->registerUnitRatio(Metre::class, 1000);
            $this->registerUnitRatio(Centimetre::class, 10);
            $this->registerUnitRatio(Millimetre::class, 1);
        }
    }
    ```
3. Now you can convert and calculate your own unit!

    ```
    $height = (new Length(1))
        ->addMetre(1.7)
        ->addMillimetre(1);

    $height->stringify(function (Metre $metre, Centimetre $centimetre, Millimetre $millimetre) {
        return $metre->fmtAbbr() . ' ' . $centimetre->fmtAbbr() . ' ' . $millimetre->fmtAbbr();
    }); // 1m 70cm 1mm
    ```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2507d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37746586?v=4)[abcyg](/maintainers/burobo)[@burobo](https://github.com/burobo)

---

Top Contributors

[![burobo](https://avatars.githubusercontent.com/u/37746586?v=4)](https://github.com/burobo "burobo (5 commits)")

---

Tags

composerunitpackagecalculator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/burobo-ukon/health.svg)

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

###  Alternatives

[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k306.6M74](/packages/jean85-pretty-package-versions)[composer/satis

Simple Repository Generator

3.3k1.4M19](/packages/composer-satis)[fxp/composer-asset-plugin

NPM/Bower Dependency Manager for Composer

8884.8M41](/packages/fxp-composer-asset-plugin)[consolidation/cgr

Safer alternative to 'composer global require'.

449214.5k](/packages/consolidation-cgr)[foxy/foxy

Fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer

177289.8k26](/packages/foxy-foxy)[netojose/laravel-bootstrap-4-forms

Bootstrap 4 form builder for Laravel 5

180119.8k](/packages/netojose-laravel-bootstrap-4-forms)

PHPackages © 2026

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