Numbers
basisPoints
Display decimal ratios as basis points, without financial advice.
Use it in your component
Standalone component
import { Component } from '@angular/core';
import { BasisPointsPipe } from 'extra-pipe';
@Component({
standalone: true,
imports: [BasisPointsPipe],
template: `{{ 0.0125 | basisPoints }}`,
})
export class ExampleComponent {
}
Template
{{ 0.0125 | basisPoints }}
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: maximumFractionDigits. Locale is controlled separately.
Applied to the live output.
Live template data
readonly value = 0.0125;
{{ value | basisPoints: undefined: "en-US" }}
Rendered output
125 bp