Skip to content
Open
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
4 changes: 2 additions & 2 deletions lib/finance/cashflows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Function

values.each do |key, value|
define_method key do
BigDecimal.new value
BigDecimal(value)
end
end

Expand All @@ -33,7 +33,7 @@ def initialize(transactions, function)

def values(x)
value = @transactions.send(@function, Flt::DecNum.new(x[0].to_s))
[ BigDecimal.new(value.to_s) ]
[ BigDecimal(value.to_s) ]
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/finance/decimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

DecNum.context.define_conversion_to(BigDecimal) do |x|
BigDecimal.new(x.to_s)
BigDecimal(x.to_s)
end

class Numeric
Expand Down