<commit_before>(function(expect) {
  'use strict';

  describe('numberFormat', function() {
    describe('formatMoney', function() {
      it('should return a string', function() {
        expect(numberFormat.formatMoney(1)).to.be.a('string');
      });

      it('should default to 2 decimal places', function() {
        expect(numberFormat.formatMoney(1.123).substr(3)).to.have.length(2);
      });

      it('should round result if 0 passed for decimal_places', function() {
        var rounded_up = numberFormat.formatMoney(1.5, 0);
        var rounded_down = numberFormat.formatMoney(1.49, 0);

        expect(rounded_up).to.equal('$2');
        expect(rounded_down).to.equal('$1');
      });

      it('should default to "$" currency symbol', function() {
        expect(numberFormat.formatMoney(1)[0]).to.equal('$');
      });

      it('should default to "," thousands separator', function() {
        expect(numberFormat.formatMoney(1000)[2]).to.equal(',');
      });

      it('should default to "." decimal separator', function() {
        expect(numberFormat.formatMoney(1)[2]).to.equal('.');
      });

      it('should group numbers by thousands', function() {
        var formatted = numberFormat.formatMoney(1000000000);

        expect(formatted[2]).to.equal(',');
        expect(formatted[6]).to.equal(',');
        expect(formatted[10]).to.equal(',');
      });

      it('should proccess alternate currency formats', function() {
        var costa_rico = numberFormat.formatMoney(1000000, 2, '₡', '.', ',');
        var ukraine = numberFormat.formatMoney(1000000, 2, '₴', ' ', ',');
        var switzerland = numberFormat.formatMoney(1000000, 2, 'Fr. ', "'", '.');

        expect(costa_rico).to.equal('₡1.000.000,00');
        expect(ukraine).to.equal('₴1 000 000,00');
        expect(switzerland).to.equal("Fr. 1'000'000.00");
      });
    });

    describe('unformatMoney', function() {
      it('should return a number', function() {
        expect(numberFormat.unformatMoney('1')).to.be.a('number');
      });

      it('should return the numeric representation of a string', function() {
        expect(numberFormat.unformatMoney('1')).to.equal(1);
        expect(numberFormat.unformatMoney('100 goats')).to.equal(100);
        expect(numberFormat.unformatMoney('1,000,000')).to.equal(1000000);
        expect(numberFormat.unformatMoney('-1,000.985')).to.equal(-1000.985);<commit_msg>Passing undefined for decimal places arg of formatMoney in alt currency format test, to trigger default.<commit_after>(function(expect) {
  'use strict';

  describe('numberFormat', function() {
    describe('formatMoney', function() {
      it('should return a string', function() {
        expect(numberFormat.formatMoney(1)).to.be.a('string');
      });

      it('should default to 2 decimal places', function() {
        expect(numberFormat.formatMoney(1.123).substr(3)).to.have.length(2);
      });

      it('should round result if 0 passed for decimal_places', function() {
        var rounded_up = numberFormat.formatMoney(1.5, 0);
        var rounded_down = numberFormat.formatMoney(1.49, 0);

        expect(rounded_up).to.equal('$2');
        expect(rounded_down).to.equal('$1');
      });

      it('should default to "$" currency symbol', function() {
        expect(numberFormat.formatMoney(1)[0]).to.equal('$');
      });

      it('should default to "," thousands separator', function() {
        expect(numberFormat.formatMoney(1000)[2]).to.equal(',');
      });

      it('should default to "." decimal separator', function() {
        expect(numberFormat.formatMoney(1)[2]).to.equal('.');
      });

      it('should group numbers by thousands', function() {
        var formatted = numberFormat.formatMoney(1000000000);

        expect(formatted[2]).to.equal(',');
        expect(formatted[6]).to.equal(',');
        expect(formatted[10]).to.equal(',');
      });

      it('should proccess alternate currency formats', function() {
        var costa_rico = numberFormat.formatMoney(1000000, undefined, '₡', '.', ',');
        var ukraine = numberFormat.formatMoney(1000000, undefined, '₴', ' ', ',');
        var switzerland = numberFormat.formatMoney(1000000, undefined, 'Fr. ', "'", '.');

        expect(costa_rico).to.equal('₡1.000.000,00');
        expect(ukraine).to.equal('₴1 000 000,00');
        expect(switzerland).to.equal("Fr. 1'000'000.00");
      });
    });

    describe('unformatMoney', function() {
      it('should return a number', function() {
        expect(numberFormat.unformatMoney('1')).to.be.a('number');
      });

      it('should return the numeric representation of a string', function() {
        expect(numberFormat.unformatMoney('1')).to.equal(1);
        expect(numberFormat.unformatMoney('100 goats')).to.equal(100);
        expect(numberFormat.unformatMoney('1,000,000')).to.equal(1000000);
        expect(numberFormat.unformatMoney('-1,000.985')).to.equal(-1000.985);
{'fraction_non_alphanumeric': 0.18181818181818182, 'fraction_numerical': 0.051629884592022675, 'mean_word_length': 3.277056277056277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '600223', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1450, 'n_words': 258}