← All pipes
Numbers

percentileBy

Interpolated percentile for numeric dashboard samples.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { PercentileByPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [PercentileByPipe],
  template: `{{ [{"amount":2},{"amount":4}] | percentileBy: "amount": 50 }}`,
})
export class ExampleComponent {

}

Template
{{ [{"amount":2},{"amount":4}] | percentileBy: "amount": 50 }}

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: key, percentile. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = [
  {
    "amount": 2
  },
  {
    "amount": 4
  }
] as const;
readonly parameter0 = "amount";
readonly parameter1 = 50;
{{ value | percentileBy: parameter0: parameter1 }}

Rendered output

3