lib/papla.rb in papla-0.0.4 vs lib/papla.rb in papla-0.0.5
- old
+ new
@@ -1,5 +1,7 @@
+require 'bigdecimal'
+require 'bigdecimal/util'
require 'papla/backend'
require 'papla/version'
module Papla
# Converts a number to Polish or English words,
@@ -114,10 +116,10 @@
max = 999_999_999
raise ArgumentError, "#{number} is too big, only numbers up to #{max} are supported" if number > max
end
def self.append_cents(basic_phrase, number)
- cents = 100 * (number - number.to_i)
+ cents = 100 * (number.to_d - number.to_i)
spell_cents(basic_phrase, cents)
end
def self.backend
@backend ||= Backend.new