Skip to content

Commit

Permalink
WIP: additional test from angular#8705
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Nov 27, 2015
1 parent c512845 commit 8da86a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/ng/filter/filtersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,26 @@ describe('filters', function() {
.toBe('444,444,444,400,000,000,000.00');

});

it('should format large number',function() {
var num;
num = formatNumber(12345868059685210000, pattern, ',', '.', 2);
expect(num).toBe('12,345,868,059,685,210,000.00');
num = formatNumber(79832749837498327498274983793234322432, pattern, ',', '.', 2);
expect(num).toBe('7.98e+37');
num = formatNumber(8798327498374983274928, pattern, ',', '.', 2);
expect(num).toBe('8,798,327,498,374,983,000,000.00');
num = formatNumber(879832749374983274928, pattern, ',', '.', 2);
var msie = +((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
var msie11 = (/Trident.*7.0/.exec(navigator.userAgent.toLowerCase()));
if (msie || msie11) {
expect(num).toBe('879,832,749,374,983,100,000.00');
} else {
expect(num).toBe('879,832,749,374,983,200,000.00');
}
num = formatNumber(879832749374983274928, pattern, ',', '.', 32);
expect(num).toBe('879,832,749,374,983,200,000.00000000000000000000000000000000');
});
});

describe('currency', function() {
Expand Down

0 comments on commit 8da86a4

Please sign in to comment.