Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 1.24 KB

README.md

File metadata and controls

76 lines (57 loc) · 1.24 KB

Odds Converter

Convert odds between american, decimal, and fractional formats

Installation

You can either get the files from GIT or you can install the library via Composer. To use Composer, simply add the following to your composer.json file.

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

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

$converter->setOdd('275');
Get fractional
print $converter->getFractional(); // 11/4
Get decimal
print $converter->getDecimal(); // 3.75

Set fractional input

$converter->setOdd('11/4');
Get moneyline (US)
print $converter->getMoneyline(); // 275
Get decimal
print $converter->getDecimal(); // 3.75

Set decimal input

$converter->setOdd('3.75');
Get moneyline (US)
print $converter->getMoneyline(); // 275
Get fractional
print $converter->getFractional(); // 11/4

That's so easy