New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

odds-converter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

odds-converter

convert odds between american, decimal, and fractional formats

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Odds Converter

npm install odds-converter

var odds = require('odds-converter')

Decimal to American

Example:

odds.decimal.toAmerican(2.25); // 125.00

odds.decimal.toAmerican(1.90); // -111.11

Decimal to Fraction

odds.decimal.toFractional(1.75).simplify(); // (3/4)

odds.decimal.toFractional(3.5).simplify(); // (5/2)

Fraction to American

odds.fraction.toAmerican(7,4); // 175

odds.fraction.toAmerican(5,6); // -120

Fraction to Decimal

odds.fraction.toDecimal(3,2); // 3.2

odds.fraction.toDecimal(1,5); // 1.2

American to Decimal

odds.american.toDecimal(225); // 3.25

odds.american.toDecimal(-110); // 1.91

American to Fraction

odds.american.toFractional(225).simplify(); // (9/4)

odds.american.toFractional(-125).simplify(); // (4/5)

Keywords

sports

FAQs

Package last updated on 19 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts