From 5ae6675cbaf9a0c280270c89b4820f50a17b76e5 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 23 Apr 2015 22:19:47 -0400 Subject: [PATCH] negify` --- app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 613f57c..3fd892b 100644 --- a/app.rb +++ b/app.rb @@ -70,7 +70,7 @@ def readable_number(value) negative = false negative = true if value.to_f < 0 - value.gsub!(/-/, '') + value = value * -1 numbers.each do |number, symbol| if value.to_f / number.to_f > 1 return sprintf('%.2f', value.to_f / number.to_f) + '' + symbol + ''