// Shared money formatting for every casino surface. Kept apart from the table's // rendering so the quick-split calculator can pull in the formatter without dragging // the whole seat/chip UI along with it. const Money = { format(amount) { const value = Number(amount) || 0; return `$${value.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`; }, // "+$40.00" / "-$40.00" rather than "$-40.00" — a standings column is read at a // glance, and the sign belongs out front where the eye lands first. formatSigned(amount) { const value = Number(amount) || 0; if (value > 0) return `+${this.format(value)}`; if (value < 0) return `-${this.format(Math.abs(value))}`; return this.format(0); }, }; if (typeof module !== "undefined" && module.exports) { module.exports = Money; }