Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8da86a4

Browse files
committedNov 27, 2015
WIP: additional test from #8705
1 parent c512845 commit 8da86a4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎test/ng/filter/filtersSpec.js

+20
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,26 @@ describe('filters', function() {
111111
.toBe('444,444,444,400,000,000,000.00');
112112

113113
});
114+
115+
it('should format large number',function() {
116+
var num;
117+
num = formatNumber(12345868059685210000, pattern, ',', '.', 2);
118+
expect(num).toBe('12,345,868,059,685,210,000.00');
119+
num = formatNumber(79832749837498327498274983793234322432, pattern, ',', '.', 2);
120+
expect(num).toBe('7.98e+37');
121+
num = formatNumber(8798327498374983274928, pattern, ',', '.', 2);
122+
expect(num).toBe('8,798,327,498,374,983,000,000.00');
123+
num = formatNumber(879832749374983274928, pattern, ',', '.', 2);
124+
var msie = +((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
125+
var msie11 = (/Trident.*7.0/.exec(navigator.userAgent.toLowerCase()));
126+
if (msie || msie11) {
127+
expect(num).toBe('879,832,749,374,983,100,000.00');
128+
} else {
129+
expect(num).toBe('879,832,749,374,983,200,000.00');
130+
}
131+
num = formatNumber(879832749374983274928, pattern, ',', '.', 32);
132+
expect(num).toBe('879,832,749,374,983,200,000.00000000000000000000000000000000');
133+
});
114134
});
115135

116136
describe('currency', function() {

0 commit comments

Comments
 (0)
This repository has been archived.