Sha256: b4997e3b0ed75d12151238feacfd11452a39ed93e7a354434ea7a4a96576d826

Contents?: true

Size: 398 Bytes

Versions: 3

Compression:

Stored size: 398 Bytes

Contents

module Reporta
  module BoxHelper
    include ActionView::Helpers::NumberHelper
    def readable_number(num)
      num = num || 0
      opts = {units: { thousand: 'K', million: 'M', billion: 'B'}}
      number_to_human(num, opts)
    end

    def box_for(report, locals={})
      locals.reverse_merge!(report: report)
      render partial: 'reporta/reports/box', locals: locals
    end
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reporta-modules-0.0.3 lib/reporta/box_helper.rb
reporta-modules-0.0.2 lib/reporta/box_helper.rb
reporta-modules-0.0.1 lib/reporta/box_helper.rb