<ng-pluralize count="data.amount | customFilter" when="{1: 'one item', 'other': '{} items'}"> </ng-pluralize>
Is it possible to apply a custom filter to the count property? The customFilter function should return either an integer value or a float with 2 decimal places (e.g., 2, not 2.00 or 2.10). The filter should be implemented as follows:
app.filter('customFilter', function() {
return function(input) {
input = parseFloat(input);
if (!Number.isInteger(input)) {
return input.toFixed(2);
}
return input;
}
}
I keep encountering errors.
Syntax Error: Token '-' is an unexpected token at column 23 of the expression [this.amount | customFilter-0] starting at [-0].