Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions spec/pdf/core_decimal_rounding_spec.r

This file was deleted.

16 changes: 16 additions & 0 deletions spec/pdf/core_decimal_rounding_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe PDF::Core do
example_group 'Decimal rounding' do
it 'rounds floating point numbers to four decimal places' do
expect(described_class.real(1.23456789)).to eq '1.23457'
end

it 'is able to create a PDF parameter list of rounded decimals' do
expect(described_class.real_params([1, 2.345678, Math::PI]))
.to eq '1.0 2.34568 3.14159'
end
end
end