diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..5fed47d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,11 @@ module ApplicationHelper + # Custom helper for better display of big numbers + # @example number_by_magnitude(4242) + # "4.2K" + # + # @param number[Numeric] + # @return [String] human friendly respresentation + def number_by_magnitude(number) + number_to_human(number, units: { thousand: :K, million: :M, billion: :G }) + end end diff --git a/app/views/clients/_client.html.erb b/app/views/clients/_client.html.erb index 2a21339..3f5a2eb 100644 --- a/app/views/clients/_client.html.erb +++ b/app/views/clients/_client.html.erb @@ -1,13 +1,11 @@