Sha256: 584a823ef7b4c5213dbcfce3f9bca27cd753f14b967bda55cfe8982d691d3432

Contents?: true

Size: 414 Bytes

Versions: 16

Compression:

Stored size: 414 Bytes

Contents

# -*- encoding: utf-8 -*-
#
module Brcobranca
  module Limpeza
    # Transforma Float em String preservando o zero a direita.
    #
    # @return [String]
    # @example
    #  1.9  #=> 190
    #  1.93 #=> 193
    def limpa_valor_moeda
      inicio, fim = to_s.split(/\./)
      (inicio + fim.ljust(2, '0'))
    end
  end
end

[Float, String].each do |klass|
  klass.class_eval { include Brcobranca::Limpeza }
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
brcobranca-9.2.4 lib/brcobranca/limpeza.rb
brcobranca-9.2.3 lib/brcobranca/limpeza.rb
brcobranca-9.2.2 lib/brcobranca/limpeza.rb
brcobranca-9.2.1 lib/brcobranca/limpeza.rb
brcobranca-9.2.0 lib/brcobranca/limpeza.rb
brcobranca-9.1.2 lib/brcobranca/limpeza.rb
brcobranca-9.1.1 lib/brcobranca/limpeza.rb
brcobranca-9.1.0 lib/brcobranca/limpeza.rb
brcobranca-9.0.0 lib/brcobranca/limpeza.rb
brcobranca-8.0.0 lib/brcobranca/limpeza.rb
brcobranca-7.3.0 lib/brcobranca/limpeza.rb
brcobranca-7.2.2 lib/brcobranca/limpeza.rb
brcobranca-7.2.1 lib/brcobranca/limpeza.rb
brcobranca-7.2.0 lib/brcobranca/limpeza.rb
brcobranca-7.1.0 lib/brcobranca/limpeza.rb
brcobranca-7.0.0 lib/brcobranca/limpeza.rb