Sha256: 6f4c44e2dbd95d7cd1cf063251fee29e814f618a66cdf6a42e740eefc8a5f160

Contents?: true

Size: 695 Bytes

Versions: 1

Compression:

Stored size: 695 Bytes

Contents

module FlydataCore
module TableDef

require 'flydata-core/table_def/value_conv'

describe ValueConv do
  describe '.strip_currency_format' do
    subject { described_class.strip_currency_format(value) }

    context 'in dollar format' do
      let(:value) { "$2,392.40" }
      it { is_expected.to eq "2392.40" }
    end

    context 'in JPY format' do
      let(:value) { "JPY2,382,929" }
      it { is_expected.to eq "2382929" }
    end

    context 'in INR format' do
      let(:value) { "12,23,382.29" }
      it { is_expected.to eq "1223382.29" }
    end

    context 'in DKK format' do
      let(:value) { "10.382,29" }
      it { is_expected.to eq "10382.29" }
    end
  end
end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flydata-0.7.1 flydata-core/spec/table_def/value_conv_spec.rb