Deno project to convert betting odds

Deno project to convert betting odds

Odds converter A simple class and CLI tool to convert betting odds between formats.

Odds converter

A simple class and CLI tool to convert betting odds between formats.

CLI

Install

deno install -n odds https://deno.land/x/odds_converter/cli.ts

Usage

odds +750

Outputs:

.------------------------------.
|        Converted Odds        |
|------------------------------|
|        Type         | Value  |
|---------------------|--------|
| US                  |   +750 |
| Decimal             |    8.5 |
| Fraction            |   15/2 |
| Implied probability | 11.76% |
'------------------------------'

Odds class

Install

import { Odds } from 'https://deno.land/x/odds_converter/odds.ts';

Usage

let odds = new Odds(1.5);
console.log(odds.decimalOdds); // 1.5
console.log(odds.usOdds); // -200
console.log(odds.usOddsString); // "-200"
console.log(odds.fractionOdds); // "1/2"
console.log(odds.impliedProbability); // 0.6666666666
console.log(odds.impliedProbabilityString); // 66.67%

odds = Odds.fromUS("+300");
console.log(odds.decimalOdds); // 4
console.log(odds.usOdds); // 300
console.log(odds.usOddsString); // "+300"
console.log(odds.fractionOdds); // "3/1"
console.log(odds.impliedProbability); // 0.25
console.log(odds.impliedProbabilityString); // "25%"

odds = Odds.fromFraction("5/4");
console.log(odds.decimalOdds); // 2.25
console.log(odds.usOdds); // 125
console.log(odds.usOddsString); // "+125"
console.log(odds.fractionOdds); // "5/4"
console.log(odds.impliedProbability); // 0.4444444444444
console.log(odds.impliedProbabilityString); // "44.44%"

Download Details:

Author: c-m-hunt

Source Code: https://github.com/c-m-hunt/odds-converter

deno nodejs node javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

AEM Querybuilder for JavaScript (Browser, Node, Deno)

Helix Querybuilder .AEM Querybuilder for JavaScript (Browser, Node, Deno)

NKeys for JavaScript - Node.js, Browsers, and Deno

A public-key signature system based on Ed25519 for the NATS ecosystem system for JavaScript. The nkeys.js library works in Deno, Node.js, and the browser!

Javascript module for easily generating mazes,compatible with both Deno and Node

A work-in-progress Javascript maze generator module, compatible with both Deno and Node.

Deno Tutorial for Beginners: Deno vs. Node: Better Than NodeJS?

Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.

What is Deno? The Node.JS Killer? The Deno-minator to Node?

What is Deno? The Node.JS Killer? The Deno-minator to Node? Deno is the new hype and will it be better than node.js? Deno is a secure runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language that addresses Node’s shortcomings