Numbers
percentageChange
Signed percentage change from a nonzero baseline.
Use it in your component
Standalone component
import { Component } from '@angular/core';
import { PercentageChangePipe } from 'extra-pipe';
@Component({
standalone: true,
imports: [PercentageChangePipe],
template: `{{ 120 | percentageChange: 100 }}`,
})
export class ExampleComponent {
}
Template
{{ 120 | percentageChange: 100 }}
Try it live.
The output below runs the packed library. Edit data, not code.
Use double quotes for text, or a number, array, object or null.
Ordered parameters: baseline. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = 120;
readonly parameter0 = 100;
{{ value | percentageChange: parameter0 }}
Rendered output
20