Skip to content
/ odds Public
forked from alexsabdev/odds

PHP package for dealing with different formats of betting odds: decimal (European), fractional (British), and moneyline (American)

License

Notifications You must be signed in to change notification settings

swiftroot/odds

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odds Build Status

PHP package for dealing with different formats of betting odds: decimal (European), fractional (British), and moneyline (American)

Features

  • Use classes of Decimal/fractional/moneyline odds
  • Convert values of odds (all directions)

Requirements

  • PHP 7.1+
  • Composer

Installation

  • Require the package using Composer
composer require alexsabdev/odds

Usage

  • Create an instance of any odd
require 'vendor/autoload.php';

use Alexsabdev\Odds\DecimalOdd;
...

$odd = new DecimalOdd(3.5);
  • Show the value
/**
* Prints '3.5'
*/
$decimal = $odd->value();
print_r($decimal);
  • Convert to other odds
/**
* Prints '5/2'
*/
$fractional = $odd->toFractional()->value();
print_r($fractional);

/**
* Prints '+250'
*/
$moneyline = $odd->toMoneyline()->value();
print_r($moneyline);

License

This is an open-sourced software licensed under the MIT license.

About

PHP package for dealing with different formats of betting odds: decimal (European), fractional (British), and moneyline (American)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%