Skip to content

Commit

Permalink
test(formatNumber): check exponentially small numbers
Browse files Browse the repository at this point in the history
Adds test from angular#10252

Closes angular#10252
Closes angular#10246
  • Loading branch information
petebacondarwin committed Nov 30, 2015
1 parent b732508 commit 91a8b9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ng/filter/filtersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ describe('filters', function() {
expect(number(-1e-7, 6)).toEqual('0.000000');
expect(number(-1e-8, 9)).toEqual('-0.000000010');
});

it('should filter exponentially small numbers when no fraction specified', function() {
expect(number(1e-10)).toEqual('0.000');
expect(number(0.0000000001)).toEqual('0.000');

expect(number(-1e-10)).toEqual('0.000');
expect(number(-0.0000000001)).toEqual('0.000');
});
});

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

0 comments on commit 91a8b9f

Please sign in to comment.