From 91a8b9fb127e12bc6b4aba676fdbf4e3bdd381a5 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Mon, 30 Nov 2015 21:44:25 +0000 Subject: [PATCH] test(formatNumber): check exponentially small numbers Adds test from #10252 Closes #10252 Closes #10246 --- test/ng/filter/filtersSpec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js index 34a5e79c3d12..979fd2bf02b8 100644 --- a/test/ng/filter/filtersSpec.js +++ b/test/ng/filter/filtersSpec.js @@ -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() {