Remove percentage filter
This commit removes the percentage filter. We don't use this now. Change-Id: I057c78bcff2a53a43feed5e05ad26bd3143bbf23
This commit is contained in:
parent
89fee47d1a
commit
a85ccccaf5
@ -1,14 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var filtersModule = require('./_index.js');
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
function percentage($filter) {
|
||||
return function(input, decimals) {
|
||||
return $filter('number')(input * 100, decimals || 2) + '%';
|
||||
};
|
||||
}
|
||||
|
||||
filtersModule.filter('percentage', percentage);
|
@ -1,21 +0,0 @@
|
||||
describe('Percentage Filter', function() {
|
||||
|
||||
var percentageFilter;
|
||||
|
||||
beforeEach(function() {
|
||||
module('app');
|
||||
module('app.filters');
|
||||
});
|
||||
|
||||
beforeEach(inject(function(_percentageFilter_) {
|
||||
percentageFilter = _percentageFilter_;
|
||||
}));
|
||||
|
||||
it('should format a percentage correctly', function() {
|
||||
expect(percentageFilter(0.987654321)).toBe('98.77%');
|
||||
});
|
||||
|
||||
it('should format a percentage using the specified decimal precision', function() {
|
||||
expect(percentageFilter(0.987654321, 3)).toBe('98.765%');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user