Sha256: 04f534e5b9cb6a228b238373d3e8454e63d47e1950eb69ec33819ffec4794084
Contents?: true
Size: 563 Bytes
Versions: 5
Compression:
Stored size: 563 Bytes
Contents
module IEX module Resources class Resource < Hashie::Trash include Hashie::Extensions::IgnoreUndeclared def self.float_to_percentage(float_number) return unless float_number.is_a? Numeric return '+0.00%' if float_number.zero? [ float_number.positive? ? '+' : '', format('%.2f', float_number * 100), '%' ].join end def self.to_dollar(amount:, ignore_cents: true) MoneyHelper.money_to_text(amount, 'USD', nil, no_cents: ignore_cents) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems