Skip to content

🎲 A tiny library with no deps to give you the odds of a percent chance

Notifications You must be signed in to change notification settings

hughrawlinson/never-tell-me-the-odds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

never-tell-me-the-odds

Don't use this!!

A micro library to return a ratio (the odds), e.g. 3720 to 1, or 1 in 6, given a percentage.

It's deceptively tricky to code, to handle accuracy properly. Mostly it's an outlet for me to practice test driven development in my spare time. Please don't use this!

Usage

import theOdds from 'never-tell-me-the-odds';

theOdds(20);

// {
//   "numerator": 1,
//   "denominator" : 5
// }

About

🎲 A tiny library with no deps to give you the odds of a percent chance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages