aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ng/filter/filtersSpec.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js
index 883e91f6..cbb41841 100644
--- a/test/ng/filter/filtersSpec.js
+++ b/test/ng/filter/filtersSpec.js
@@ -91,6 +91,13 @@ describe('filters', function() {
expect(currency()).toBe('');
expect(currency('abc')).toBe('');
});
+
+ it('should handle zero and nearly-zero values properly', function() {
+ // This expression is known to yield 4.440892098500626e-16 instead of 0.0.
+ expect(currency(1.07 + 1 - 2.07)).toBe('$0.00');
+ expect(currency(0.008)).toBe('$0.01');
+ expect(currency(0.003)).toBe('$0.00');
+ });
});