F033 — Rounding Algorithms
| Field | Value |
|---|---|
| ID | F033 |
| Phase | 4 — Configuration |
| Jira | TBD — create from HEDGE-133 |
| Status | TS ⬜ · JS ⬜ · UMA ⬜ |
Business Rule
A Rounding Algorithm converts the precise computed payout odds (oddsActual) into a player-friendly rounded value (oddsRounded). Rounding is optional — enabled or disabled by the operator at installation.
Example:
oddsActual | Rounding mode | oddsRounded |
|---|---|---|
| 3.71 | Integer | 3 |
| 3.71 | 1 decimal place | 3.7 |
| 3.88 | Integer | 3 |
| 3.88 | 1 decimal place | 3.9 |
| 2.978 | 1 decimal place | 2.9 (as seen in coredata) |
Source: Game Concept Document
“In Texas Hedge’Em context a ‘Rounding Algorithm’ is the term given to rounding the payout-odds presented to a player to an integer or whole-number-fraction. For example, instead of presenting odds of 3.71:1 the player would be presented odds of 3:1. Rounding Algorithms are optional and enabled or disabled at installation.”
“The target RTP is set by the operator at installation time but the actual RTP can be influenced by other configuration parameters such as ‘Rounding Algorithms’.”
Evidence in Coredata
The coredata (ported from JS game records) shows bothoddsActual and oddsRounded per hand per stage:
Rounding Modes (to be confirmed)
| Mode | Description | Example |
|---|---|---|
| Integer | Round to nearest whole number | 3.71 → 4 or 3 |
| Integer (floor) | Always round down | 3.71 → 3 |
| 1 decimal place | Round to 1 d.p. | 3.71 → 3.7 |
| Whole-number fraction | Round to nearest 0.5 step | 3.71 → 3.5 |
TypeScript Implementation
Current status:oddsRounded is consumed directly from pre-computed coredata. No rounding is performed client-side. The oddsRounded field already contains the rounded value.
Display in GameScene.ts (HEDGE-86 — suppress trailing .0):
Acceptance Criteria
| # | Criterion | JS | TS | UMA |
|---|---|---|---|---|
| AC1 | oddsRounded derived from oddsActual via configured algorithm | ⬜ | N/A | ⬜ |
| AC2 | Integer rounding mode: oddsRounded is a whole number | ⬜ | ⬜ | ⬜ |
| AC3 | Displayed odds match oddsRounded, not oddsActual | ⬜ | ✅ | ⬜ |
| AC4 | Rounding can be disabled (display oddsActual directly) | ⬜ | ⬜ | ⬜ |
| AC5 | Trailing .0 suppressed in display (x5, not x5.0) | N/A | ✅ | ⬜ |
Version Parity
| Version | Status | Notes |
|---|---|---|
| JS (reference) | ⬜ Not audited | Rounding applied server-side; client reads odds_rounded |
| TS | ⬜ Partial | Reads pre-rounded values; display formatting ✅ (HEDGE-86) |
| UMA | ⬜ Not audited | Phase 5 |
Related Features
- F006 — Odds Calculation (
oddsActualis the input to this algorithm) - F007 — RTP Margin (margin applied before rounding)
- F024 — Odds Display (UI display of
oddsRounded) - F032 — RTP Config (operator enables/disables rounding at installation)
