Sha256: 0bfe30207bb02c2a87f0703ea937819dc3ece2bceb030ce21292992d7534494f

Contents?: true

Size: 370 Bytes

Versions: 4

Compression:

Stored size: 370 Bytes

Contents

# encoding: binary
require_relative "spec_helper"

describe "Decimal rounding" do
  it "should round floating point numbers to four decimal places" do
    PDF::Core.real(1.23456789).should == 1.2346
  end

  it "should be able to create a PDF parameter list of rounded decimals" do
    PDF::Core.real_params([1,2.34567,Math::PI]).should == "1.0 2.3457 3.1416"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pdf-core-0.6.1 spec/decimal_rounding_spec.rb
pdf-core-0.6.0 spec/decimal_rounding_spec.rb
pdf-core-0.5.1 spec/decimal_rounding_spec.rb
pdf-core-0.5.0 spec/decimal_rounding_spec.rb