diff --git a/app.rb b/app.rb index 9d07fc8..7b8dc94 100644 --- a/app.rb +++ b/app.rb @@ -66,6 +66,10 @@ def players } end +def money_style(value) + value.to_f < 0 ? 'color:#a94442' : 'color:#3c763d' +end + def readable_number(value) if value.to_f < 0 negative = true @@ -83,7 +87,7 @@ def readable_number(value) end value = 0.0 unless value - return sprintf('%.2f', value) + "_" + return sprintf('%.2f', value) + " " end def numbers diff --git a/views/index.erb b/views/index.erb index d1b4a74..fa8cf99 100644 --- a/views/index.erb +++ b/views/index.erb @@ -15,7 +15,7 @@ <%= raid.attacker %> <%= raid.defender %> <%= readable_number(raid.soldiers) %> - <%= readable_number(raid.money) %> + <%= readable_number(raid.money) %> <%= raid.created_at.strftime('%H:%M on %m-%d-%Y') %> <% end %>