🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Fix #294: format Total Value through the shared currency formatter
Omega (QA)47768e4ae6cb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 89794f3..f2ec209 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,8 @@- **Docker image fails to start, fixed (#293):** the 1.0.5 image crashes on boot with "ModuleNotFoundError: No module named 'packaging'" and gunicorn never starts. The gevent worker class gunicorn loads imports the packaging module, but gunicorn declares packaging only in its optional "gevent" extra, and the requirements file installs plain gunicorn, so pip never installed it. The 1.0.4 image worked because it copied the builder's whole /usr/local, which happened to carry packaging along; the 1.0.5 image diet copies only the virtualenv, which exposed the missing pin. packaging is now pinned explicitly in the requirements file, and a regression test guards the pin. Verified in clean virtualenvs built from the old and new requirements: the old set reproduces the ModuleNotFoundError on worker load, the new set loads the worker.- _Files: `backend/requirements.txt`, `tests/test_requirements_packaging.py`_+- **Status dashboard Total Value formatting, fixed (#294):** the Total Value card formatted its amount by hand, with the currency symbol hardcoded in front, no spacing, and no thousands separators, ignoring the currency position setting: a user with Serbian Dinar and the symbol set to appear after the amount saw "дин182591.00" on the dashboard while their warranty entries correctly showed "52790.00 дин". The card now uses the same shared currency formatter as the warranty cards, honoring the position setting and the symbol spacing, and the shared formatter now adds locale thousands grouping, so the total reads "182,591.00 дин". The card also no longer forces the value onto one line, so large totals wrap inside the card instead of overflowing it.+ - _Files: `frontend/status.js`, `frontend/script.js`, `frontend/js/lib/currency.js`, `frontend/style.css`_## 1.0.5 - 2026-11-09diff --git a/frontend/js/lib/currency.js b/frontend/js/lib/currency.jsindex aacb5df..c4f105d 100644--- a/frontend/js/lib/currency.js+++ b/frontend/js/lib/currency.js@@ -83,7 +83,10 @@ export function getCurrencyPosition() {}export function formatCurrencyHTML(amount, symbol, position) {- const formatted = Number.parseFloat(amount || 0).toFixed(2);+ const formatted = Number.parseFloat(amount || 0).toLocaleString(undefined, {+ minimumFractionDigits: 2,+ maximumFractionDigits: 2,+ });if (position === 'right') {return `<span>${formatted}</span><span class="currency-symbol currency-right">${symbol}</span>`;}diff --git a/frontend/script.js b/frontend/script.jsindex a1a7ba2..cede61f 100644--- a/frontend/script.js+++ b/frontend/script.js@@ -6729,8 +6729,11 @@ function getCurrencyPosition() {}function formatCurrencyHTML(amount, symbol, position) {- const formattedAmount = parseFloat(amount).toFixed(2);-+ const formattedAmount = (parseFloat(amount) || 0).toLocaleString(undefined, {+ minimumFractionDigits: 2,+ maximumFractionDigits: 2+ });+if (position === 'right') {return `<span>${formattedAmount}</span><span class="currency-symbol currency-right">${symbol}</span>`;} else {diff --git a/frontend/status.js b/frontend/status.jsindex 109f71d..d97759e 100644--- a/frontend/status.js+++ b/frontend/status.js@@ -429,7 +429,15 @@if (voidedEl) voidedEl.textContent = statusData.voided || 0;if (totalValueEl) {const val = parseFloat(statusData.total_value || 0);- totalValueEl.textContent = userCurrencySymbol + val.toFixed(2);+ // Use the shared currency formatter (same one the warranty+ // cards use) so the total honors the currency position+ // setting, spacing, and locale grouping (#294).+ if (typeof formatCurrencyHTML === 'function') {+ const position = typeof getCurrencyPosition === 'function' ? getCurrencyPosition() : 'left';+ totalValueEl.innerHTML = formatCurrencyHTML(val, userCurrencySymbol, position);+ } else {+ totalValueEl.textContent = userCurrencySymbol + val.toFixed(2);+ }}}diff --git a/frontend/style.css b/frontend/style.cssindex 190b06a..b3cd599 100644--- a/frontend/style.css+++ b/frontend/style.css@@ -1782,7 +1782,10 @@ input:checked + .toggle-slider:before {.status-card[data-status="total_value"] .count {font-size: 1.4rem;- white-space: nowrap;+ /* Large totals must stay inside the card: allow the value to+ wrap (amount and symbol are separate spans) instead of+ overflowing on one nowrap line (#294). */+ overflow-wrap: anywhere;}.info-popover {