lib/iex/resources/resource.rb in iex-ruby-client-1.5.0 vs lib/iex/resources/resource.rb in iex-ruby-client-1.6.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module IEX
module Resources
class Resource < Hashie::Trash
include Hashie::Extensions::IgnoreUndeclared
@@ -25,10 +27,12 @@
'%'
].join
end
def self.to_dollar(amount:, ignore_cents: true)
- MoneyHelper.money_to_text(amount, 'USD', nil, no_cents: ignore_cents)
+ return nil unless amount
+
+ Money.new(amount * 100, 'USD').format(decimal_mark: '.', no_cents: ignore_cents, thousands_separator: ',')
end
end
end
end