Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sielay/bookmaker
Library to manage and calculate odds.
https://github.com/sielay/bookmaker
Last synced: 9 days ago
JSON representation
Library to manage and calculate odds.
- Host: GitHub
- URL: https://github.com/sielay/bookmaker
- Owner: sielay
- License: mit
- Created: 2015-02-15T20:39:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-02-16T08:39:54.000Z (over 9 years ago)
- Last Synced: 2024-10-11T13:16:37.270Z (25 days ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bookmaker
This lib is meant to help you work with odds, for instance in gambling project.
To install use bower or npm
```
bower install bookmaker --save
``````
npm install bookmakerjs --save
```You have at the moment series of methods and you can view their use in `test.js`.
Run test:
```
mocha node_modules/bookmaker/test.js
```## API
### fractionToPercent
fractionToPercent(numerator:Number, denomiator:Number) : NumberReturn percent as fraction of 1.
### fractionToDecimal
fractionToDecimal(numerator:Number, denomiator:Number) : Number### fractionToAmerican
fractionToAmerican(numerator:Number, denomiator:Number) : Number### decimalToFraction
decimalToFraction(decimal:Number): String### decimalToPercent
decimalToPercent(decimal:Number): Number### decimalToAmerican
decimalToAmerican(decimal:Number): Number### percentToDecimal
percentToDecimal(percent:Number): Number### percentToFraction
percentToFraction(percent:Number): String### percentToAmerican
percentToAmerican(percent:Number): Number### americanToDecimal
americanToDecimal(american:Number): Number### americanToPercent
americanToPercent(american:Number): Number### americanToFraction
americanToFraction(american:Number): String### winSingle
winSingle(decimal:Number, money:Number): Number
winSingle(any:String, money:Number): Number - see parse function### winEachWaySingle
winEachWaySingle(decimal:Number, placeOdds:Number, moneyWin:Number, moneyPlace:Number): Number
winEachWaySingle(any:String, placeOdds:Number, moneyWin:Number, moneyPlace:Number): Number### winEachWaySingleDetailed
See `test.js`### winAccumulator
winEachWaySingle(moneyWin:Number, moneyPlace:Number, [decimal:Number, placeOdds:Number], ...):
Number### oddsEachWaySingle
oddsEachWaySingle(winOdds:Any, placeOdds:Any):Object - see `test.js`### combineOddsEachWay
combineOddsEachWAy(list:Array): Object - see `test.js`### combineOdds
combineOdds(list:array): Number - see `test.js`### parse
parse(any:String) : Number - decimalAccepts:
* `1/4` fracitons
* `50%` percents
* `1:5` odds (: mean divide sign)
* numbers as decimals
## Author
[Lukasz Sielski](http://github.com/sielay)
## Licence
MIT - just because