Class: AchClient::Helpers::DollarsToCents

Inherits:
Object
  • Object
show all
Defined in:
lib/ach_client/helpers/dollars_to_cents.rb

Overview

Turns dollars into cents

Class Method Summary collapse

Class Method Details

.dollars_to_cents(dollars) ⇒ Fixnum

Returns cents.

Parameters:

  • dollars (Float | BigDecimal | Fixnum | Integer)

Returns:

  • (Fixnum)

    cents



10
11
12
# File 'lib/ach_client/helpers/dollars_to_cents.rb', line 10

def self.dollars_to_cents(dollars)
  (dollars.to_f.round(2) * 100).to_i
end