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

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

sharapov/odds-converter
=======================

Convert odds between american, decimal, and fractional formats

1.01(8y ago)92802[1 issues](https://github.com/sharapov-outsource/odds-converter/issues)GPL-3.0PHPPHP ^5.6 || ^7.0

Since May 13Pushed 8y ago2 watchersCompare

[ Source](https://github.com/sharapov-outsource/odds-converter)[ Packagist](https://packagist.org/packages/sharapov/odds-converter)[ Docs](http://sharapov.biz/)[ RSS](/packages/sharapov-odds-converter/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Odds Converter
==============

[](#odds-converter)

Convert odds between american, decimal, and fractional formats

Installation
------------

[](#installation)

You can either get the files from GIT or you can install the library via [Composer](getcomposer.org). To use Composer, simply add the following to your `composer.json` file.

```
{
    "require": {
        "sharapov/odds-converter": "1.01"
    }
}
```

How to use it?
--------------

[](#how-to-use-it)

```
require_once "../vendor/autoload.php";

$converter = new \Sharapov\OddsConverter\OddsConverter($odd);
```

Set up your input odd in the decimal, fractional or moneyline (US) format

#### Set moneyline (US) input

[](#set-moneyline-us-input)

```
$converter->setOdd('275');
```

##### Get fractional

[](#get-fractional)

```
print $converter->getFractional(); // 11/4
```

##### Get decimal

[](#get-decimal)

```
print $converter->getDecimal(); // 3.75
```

#### Set fractional input

[](#set-fractional-input)

```
$converter->setOdd('11/4');
```

##### Get moneyline (US)

[](#get-moneyline-us)

```
print $converter->getMoneyline(); // 275
```

##### Get decimal

[](#get-decimal-1)

```
print $converter->getDecimal(); // 3.75
```

#### Set decimal input

[](#set-decimal-input)

```
$converter->setOdd('3.75');
```

##### Get moneyline (US)

[](#get-moneyline-us-1)

```
print $converter->getMoneyline(); // 275
```

##### Get fractional

[](#get-fractional-1)

```
print $converter->getFractional(); // 11/4
```

That's so easy

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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 ~0 days

Total

2

Last Release

3284d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafc5607942948b01d9968da81574beaa353e93f9a2ea1f2ec3f89e9d02f539?d=identicon)[sharapov-outsource](/maintainers/sharapov-outsource)

---

Top Contributors

[![sharapov-outsource](https://avatars.githubusercontent.com/u/1851556?v=4)](https://github.com/sharapov-outsource "sharapov-outsource (4 commits)")

---

Tags

conversionformulasoddsphpsportsconversionoddssportsformulas

### Embed Badge

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

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

###  Alternatives

[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[spatie/color

A little library to handle color conversions

38018.9M28](/packages/spatie-color)[php-units-of-measure/php-units-of-measure

A PHP library for converting between standard units of measure.

3123.4M20](/packages/php-units-of-measure-php-units-of-measure)[florianv/laravel-swap

Currency exchange rates library for Laravel and Lumen

3342.0M2](/packages/florianv-laravel-swap)[php-unit-conversion/php-unit-conversion

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

681.2M1](/packages/php-unit-conversion-php-unit-conversion)

PHPackages © 2026

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