From e1ae5a43339cc70a49394e377799aa93da109481 Mon Sep 17 00:00:00 2001 From: 24c02 <163450896+24c02@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:15:23 -0500 Subject: [PATCH] don't show $0.00 costs they aren't real --- app/helpers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers.rb b/app/helpers.rb index 439cb33..2663d9b 100644 --- a/app/helpers.rb +++ b/app/helpers.rb @@ -45,8 +45,9 @@ module Sinatra end end module IIHelper - def render_ii(shipment, field, emoji, description, representation=nil) + def render_ii(shipment, field, emoji, description, representation=nil, nilify=true) return unless shipment[field] + return if nilify && shipment[field] == 0 "
#{emoji}: #{representation&.call(shipment) || shipment[field]}" end end