PHPackages                             adityar15/converter - 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. adityar15/converter

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

adityar15/converter
===================

This package allows you to convert majority of metrics in the most easy way.

v1.0(5y ago)012MITPHP

Since Mar 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/adityar15/converter)[ Packagist](https://packagist.org/packages/adityar15/converter)[ RSS](/packages/adityar15-converter/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

converter
=========

[](#converter)

This package allows you to convert majority of metrics in the most easy and efficient way.

To install use command

```
composer require adityar15/converter

```

The package is supported for Laravel version 6.*, 7.*, 8.\*

After installation you can import the package in your controller or whereever you are using it as

```
use adityar15\converter\Converter;

```

Length/Distance conversion
==========================

[](#lengthdistance-conversion)

The primary feautre of this package is that you can convert in the most efficient way.

1. centimeter to feet and vice versa

```
//Converter::CmtoFeet(float $value, bool $precise=true)
//the precise parameter is true by default. If set to false then value is rounded to nearest ceil value.

return Converter::CmtoFeet(178)
//this will return 5' 10.1''

//Converter::FeettoCm(string $value, int $digits=2);
//This will convert the feet value in string to centimeter in float. The value in feets is given in format 5-10 for 5feet 10inch or 5-0 or 5feet 0inch. The '-' format is //mandatory. The digits is number of digits after decimal. By default it is set to 2.

return Converter::FeettoCm('5-8.5', 2);
//this will return 173.99

```

2. inch to feet and vice versa

```
//Converter::InchtoFeet(float $value, bool $precise=true)
//the precise parameter is true by default. If set to false then value is rounded to nearest ceil value.

return Converter::InchtoFeet(70)
//this will return 5' 10''

//The inverse is also possible and very similar to FeettoCm function

return Converter::FeettoInch('5-10', int $digits=2);
//this will return 70.00

```

3. meter to feet and vice versa

```
//Converter::MetertoFeet(float $value, bool $precise=true)
//the precise parameter is true by default. If set to false then value is rounded to nearest ceil value.

return Converter::MetertoFeet(1.78)
//this will return 5' 10.1''

//The inverse is also possible and very similar to FeettoCm function

return Converter::FeettoMeter('5-10', int $digits=2);
//this will return 1.78

```

Along with this you can convert to

1. Meter to Centimeter and vice versa

```
return Converter::MetertoCm(1, 2) //(float $value, int $digits) by default digits is 2
//this will return 100.00

//to convert centimeter to meter

return Converter::CmtoMeter(100, 2) //(float $value, int $digits) by default digits is 2
//this will return 1.00

```

2. Meter to Inch and vice versa

```
return Converter::MetertoInch(1, 2) //(float $value, int $digits) by default digits is 2
//this will return 39.37

//to convert inch to meter

return Converter::InchtoMeter(39.37, 2) //(float $value, int $digits) by default digits is 2
//this will return 1.00

```

3. Centimeter to Inch and vice versa

```
return Converter::CmtoInch(2.54, 2) //(float $value, int $digits) by default digits is 2
//this will return 1.00

//to convert inch to centimeter

return Converter::InchtoMeter(1, 2) //(float $value, int $digits) by default digits is 2
//this will return 2.54

```

Weight Conversion
=================

[](#weight-conversion)

You can also convert weights. Following conversions are supported

1. Gram to Kilogram and vice versa

```
//to convert from gram to kilogram

return Converter::GtoKg(2000, 2);  //(float $value, int $digits) by default digits is 2

//This will return 2.00

//To convert Kilogram to Gram

return Converter::GtoKg(2, 2);  //(float $value, int $digits) by default digits is 2
//This will return 2000.00

```

2. Gram to Pound

```
Converter::GtoPound(float $value, int $digits) // by default digits is 2

```

3. Gram to Ounce

```
Converter::GtoOunce(float $value, int $digits) // by default digits is 2

```

4. Gram to Milligram

```
Converter::GtoMg(float $value, int $digits) // by default digits is 2

```

For now you cannot convert directly from Kg to Pounds. In that case you need to convert to Kg to grams and then grams to pounds.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

1894d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44507591?v=4)[Aditya](/maintainers/adityar15)[@adityar15](https://github.com/adityar15)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/adityar15-converter/health.svg)

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

###  Alternatives

[dg/composer-cleaner

Victor The Cleaner: removes unnecessary files from vendor directory.

1401.5M29](/packages/dg-composer-cleaner)[paragonie/random-lib

A Library For Generating Secure Random Numbers

703.3M26](/packages/paragonie-random-lib)[kartik-v/bootstrap-tabs-x

Extended Bootstrap Tabs with ability to align tabs in multiple ways, add borders, rotated titles, and more.

1021.3M1](/packages/kartik-v-bootstrap-tabs-x)[undefinedoffset/sortablegridfield

Adds drag and drop functionality to Silverstripe's GridField

941.2M50](/packages/undefinedoffset-sortablegridfield)[log1x/sage-svg

A simple package for using inline SVGs in Sage 10 projects.

121546.7k3](/packages/log1x-sage-svg)[nullpunkt/lz-string-php

PHP Class implementation of LZ-String javascript.

111485.0k20](/packages/nullpunkt-lz-string-php)

PHPackages © 2026

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