Sha256: 20e14ffe44566f6a84207edbeaa18f1cae7e1bd86e143126f9d007b521afffef

Contents?: true

Size: 728 Bytes

Versions: 7

Compression:

Stored size: 728 Bytes

Contents

// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0

var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/en.js');

describe("DecimalFormatter", function() {
  beforeEach(function() {
    formatter = new TwitterCldr.DecimalFormatter();
  });

  describe("#format", function() {
    it("should format positive decimals correctly", function() {
      expect(formatter.format(12.1)).toEqual("12.1");
    });

    it("should format negative decimals correctly", function() {
      expect(formatter.format(-12.1)).toEqual("-12.1");
    });

    it("should respect the precision option", function() {
      expect(formatter.format(-12, {precision: 3})).toEqual("-12.000");
    });
  });
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitter_cldr_js-2.3.0 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.2.4 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.2.3 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.2.2 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.2.0 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.1.0 spec/js/numbers/decimal.spec.js
twitter_cldr_js-2.0.0 spec/js/numbers/decimal.spec.js