Module: Cnab240santander::Formatacao

Included in:
Base
Defined in:
lib/cnab240santander/formatacao.rb

Instance Method Summary collapse

Instance Method Details

#formataData(dt) ⇒ Object



3
4
5
6
7
# File 'lib/cnab240santander/formatacao.rb', line 3

def formataData(dt)
  if dt.split("").uniq != ["0"]
    return DateTime.strptime(dt[0..1]+"/"+dt[2..3]+"/"+dt[4..7], "%d/%m/%Y").strftime('%d/%m/%Y')
  end
end

#preparaMoeda(n, digitos) ⇒ Object



9
10
11
# File 'lib/cnab240santander/formatacao.rb', line 9

def preparaMoeda(n, digitos)
  return (n.to_f)/(10**digitos)
end