Sha256: 5a9a4c85f6140f0bb1f0d21fa562462e0518b383372ea61d9ad7f6b37b835e46

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

module Quandl
  module Operation
    class Value
      class << self
        # rubocop:disable Style/FormatString
        def precision(data, prec = 14)
          r = []
          data.each do |row|
            new_row = [row[0]]
            row[1..-1].each do |v|
              new_row << ((v.nil? || v == Float::INFINITY) ? v : Float("%.#{prec}g" % v))
            end
            r << new_row
          end
          r
        end
        # rubocop:enable Style/FormatString
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quandl_operation-0.4.2 lib/quandl/operation/value.rb
quandl_operation-0.4.2.rc1 lib/quandl/operation/value.rb