Sha256: afbd924daa90e2e5e70a469f1ba88bb9617580a472b4b3e87431f48837603bea

Contents?: true

Size: 879 Bytes

Versions: 32

Compression:

Stored size: 879 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
      context 'with positive value' do
        let(:value) { "$2,392.40" }
        it { is_expected.to eq "2392.40" }
      end

      context 'with negative value' do
        let(:value) { "-$2,392.40" }
        it { is_expected.to eq "-2392.40" }
      end
    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

32 entries across 32 versions & 1 rubygems

Version Path
flydata-0.8.10.2 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.10.1 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.9.11 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.10 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.9 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.8 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.7 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.6 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.5 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.4 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.3 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.2 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.1 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.8.0 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.19 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.18 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.17 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.16 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.15 flydata-core/spec/table_def/value_conv_spec.rb
flydata-0.7.14 flydata-core/spec/table_def/value_conv_spec.rb