better formatting
Marco Andronaco andronacomarco@gmail.com
Sun, 06 Oct 2024 14:59:25 +0200
2 files changed,
8 insertions(+),
2 deletions(-)
M
static/js/bookmakers.js
→
static/js/bookmakers.js
@@ -40,7 +40,7 @@ bookmaker.id,
formatDate(bookmaker.created_at), formatDate(bookmaker.updated_at), bookmaker.name, - bookmaker.default_commission, + formatPercentage(bookmaker.default_commission), ]; for (const field of fields) {
M
static/js/common.js
→
static/js/common.js
@@ -25,7 +25,13 @@ return (v / 100).toFixed(2);
} function formatCash(v) { - return formatValue(v) + currency; + if (v === 0) return "-"; + return `${v > 0 ? "+" : ""}${formatValue(v)}${currency}`; +} + +function formatPercentage(v) { + if (v === 0) return "-"; + return formatValue(v) + "%"; } function formatDate(dateString) {