Glossary

Odds formats (decimal, fractional, American)

Odds come in decimal (2.50), fractional (6/4) and American (+150) formats. All three express the same price, and decimal is the easiest to calculate with.

Each format answers a different question about the same price. Decimal 2.50 is the total return per unit staked, stake included. Fractional 6/4 is the profit against the stake, 6 won for every 4 risked. American +150 is the profit on a 100-unit stake, and a negative figure such as -200 is the stake needed to win 100.

Converting takes one line each way. Decimal is fractional plus one, so 6/4 becomes 2.50. A positive American figure is (decimal - 1) × 100, so 2.50 becomes +150. Below evens it flips to -100 ÷ (decimal - 1), so 1.50 becomes -200, which is 1/2 in fractional.

The feed never serves fractional odds. A site that shows fractions converts from decimal itself, and that is where rounding bites. 2.38 has no neat fraction, so display code snaps to the nearest traditional one, 11/8, which is really 2.375. Doing the maths in decimal and converting only for display keeps those errors off the page.

Decimal also keeps the arithmetic direct. Implied probability is one divided by the price and a return is stake times price, so a tool that computes in decimal has no conversion step for a bug to hide in. Converting for the reader belongs at the very end, in the display layer.

American figures hide a trap in the sign. +150 and -150 are far apart, 2.50 against 1.67 in decimal, while evens can be written as +100 or -100 and both mean 2.00. Code that drops the sign, or treats those two evens as different prices, misreads a whole column.

In the OddsRelay feed

OddsRelay's feed serves decimal by default. oddsFormat=american works on the each-way, extra-place, bog and 2up feeds and on raw, where an American price is a signed integer, or null for a price at or below 1.0. Standard and dutching are decimal only, and asking them for anything else is a 400. meta.odds_format states which format a reply carries.

Try it on your own key

Every plan includes every feed. Sign up free and call any of them.

From the blog