Sha256: fa7d3470330333ab2be00b22470725d8b300e6d280772cd325f268373146efd7

Contents?: true

Size: 426 Bytes

Versions: 11

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

module RailsMiniProfiler
  module ProfiledRequestsHelper
    include ApplicationHelper

    def formatted_duration(duration)
      duration = (duration.to_f / 100)
      duration < 1 ? duration : duration.round
    end

    def formatted_allocations(allocations)
      number_to_human(allocations, units: { unit: '', thousand: 'k', million: 'M', billion: 'B', trillion: 'T' })
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_mini_profiler-0.6.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.5.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.4.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.3.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.2.1 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.2.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.1.3 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.1.2 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.1.1 app/helpers/rails_mini_profiler/profiled_requests_helper.rb
rails_mini_profiler-0.1.0 app/helpers/rails_mini_profiler/profiled_requests_helper.rb