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(9y ago)92802[1 issues](https://github.com/sharapov-outsource/odds-converter/issues)GPL-3.0PHPPHP ^5.6 || ^7.0

Since May 13Pushed 9y 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 2w ago

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 57% 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

3334d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1851556?v=4)[Alexander S.](/maintainers/sharapov-outsource)[@sharapov-outsource](https://github.com/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.5k11.7M157](/packages/cuyz-valinor)[florianv/swap

PHP currency conversion library for retrieving exchange rates from 30 providers, with caching and fallback.

1.3k6.7M23](/packages/florianv-swap)[spatie/color

A little library to handle color conversions

38220.5M34](/packages/spatie-color)[php-units-of-measure/php-units-of-measure

A PHP library for converting between standard units of measure.

3133.7M32](/packages/php-units-of-measure-php-units-of-measure)[ozdemirburak/iris

PHP library for color manipulation and conversion.

1201.8M20](/packages/ozdemirburak-iris)[php-unit-conversion/php-unit-conversion

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

691.2M2](/packages/php-unit-conversion-php-unit-conversion)

PHPackages © 2026

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