Sha256: 493a624220f8ec226ba5f8d8c38cd6fce4ac5d37e2c8988c9cf73f669f684646

Contents?: true

Size: 312 Bytes

Versions: 5

Compression:

Stored size: 312 Bytes

Contents

# frozen_string_literal: true

module Effective
  module TableRows
    class PercentField < Effective::TableRow

      def content
        return unless value.present?
        str = value.kind_of?(Integer) ? ('%.3f' % (value / 1000.0)) : value.to_s
        str.gsub('.000', '') + '%'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_bootstrap-1.19.10 app/models/effective/table_rows/percent_field.rb
effective_bootstrap-1.19.9 app/models/effective/table_rows/percent_field.rb
effective_bootstrap-1.19.8 app/models/effective/table_rows/percent_field.rb
effective_bootstrap-1.19.7 app/models/effective/table_rows/percent_field.rb
effective_bootstrap-1.19.6 app/models/effective/table_rows/percent_field.rb