From 35f1f57f92fde3d8ead2bcebf594890289739879 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sat, 14 Mar 2026 21:26:10 -0700 Subject: [PATCH] Fix toFixed crash when price is a string from PHP API PHP returns prices as strings (e.g. "0.000000000"). Wrap in parseFloat() before calling .toFixed(2) to prevent render crash. Co-Authored-By: Claude Opus 4.6 --- portal/menu-builder.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portal/menu-builder.html b/portal/menu-builder.html index a4cb33f..96f1004 100644 --- a/portal/menu-builder.html +++ b/portal/menu-builder.html @@ -4232,7 +4232,7 @@
${this.escapeHtml(mod.name)}
- ${mod.price > 0 ? `+$${mod.price.toFixed(2)}` : ''} + ${parseFloat(mod.price) > 0 ? `+$${parseFloat(mod.price).toFixed(2)}` : ''} ${mod.isDefault ? 'Default' : ''} ${mod.requiresSelection ? 'Required' : ''} ${mod.maxSelections > 0 ? `Max ${mod.maxSelections}` : ''} @@ -4289,7 +4289,7 @@
${this.escapeHtml(item.name)}
- $${(item.price || 0).toFixed(2)} + $${parseFloat(item.price || 0).toFixed(2)} ${hasModifiers ? `${item.modifiers.length} modifiers` : ''}