Sha256: f31ca168a95249e158a2531bd20daf78bb5cfd7b8627d521d6bd1668d79ae080

Contents?: true

Size: 284 Bytes

Versions: 8

Compression:

Stored size: 284 Bytes

Contents

class BigDecimal

  def to_deg
    (self * Terraformer::DEGREES_PER_RADIAN).round Terraformer::PRECISION
  end

  def to_rad
    (self * Terraformer::RADIANS_PER_DEGREE).round Terraformer::PRECISION
  end

  def to_json *args
    finite? ? to_f.to_json : NilClass::AS_JSON
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
terraformer-0.2.1 lib/ext/big_decimal.rb
terraformer-0.2.0 lib/ext/big_decimal.rb
terraformer-0.1.0 lib/ext/big_decimal.rb
terraformer-0.0.9 lib/ext/big_decimal.rb
terraformer-0.0.8 lib/ext/big_decimal.rb
terraformer-0.0.7 lib/ext/big_decimal.rb
terraformer-0.0.6 lib/ext/big_decimal.rb
terraformer-0.0.4 lib/ext/big_decimal.rb