From 1fafe8ea92244f393d5e85b097cfa0d553d9d597 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 14 Oct 2010 15:35:33 -0700 Subject: [PATCH] [#4653] Don't show a $ when a value field is blank --- app/helpers/contract_formatter_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/contract_formatter_helper.rb b/app/helpers/contract_formatter_helper.rb index d8998e9..3e25c7d 100644 --- a/app/helpers/contract_formatter_helper.rb +++ b/app/helpers/contract_formatter_helper.rb @@ -30,7 +30,10 @@ module ContractFormatterHelper end def format_deliverable_value_fields_as_dollar_or_percent(value) - if value.to_s.match('%') + case + when value.blank? || value.to_s.delete('$%').blank? + '' + when value.to_s.match('%') h(value) else # currency or straight amount number_to_currency(value.to_s.gsub('$',''), :precision => Deliverable::ViewPrecision, :delimiter => '', :unit => '$')