From b4f9a948ca1d21e4999bfe35c4b626b4cbd0cc43 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 23 Apr 2015 22:18:31 -0400 Subject: [PATCH] negative a different way --- app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.rb b/app.rb index a02a577..613f57c 100644 --- a/app.rb +++ b/app.rb @@ -69,8 +69,8 @@ end def readable_number(value) negative = false - #negative = true if value =~ /\-/ - #value.gsub!(/-/, '') + negative = true if value.to_f < 0 + value.gsub!(/-/, '') numbers.each do |number, symbol| if value.to_f / number.to_f > 1 return sprintf('%.2f', value.to_f / number.to_f) + '' + symbol + ''