linkDeprecatedPercentPipe
| npm Package | @angular/common |
|---|---|
| Module | import { DeprecatedPercentPipe } from '@angular/common'; |
| Source | common/src/pipes/deprecated/number_pipe.ts |
| NgModule | CommonModule |
Formats a number as a percentage according to locale rules.
linkHow To Use
number_expression | percent[:digitInfo]
linkDescription
Formats a number as percentage.
digitInfoSeeDecimalPipefor detailed description.
WARNING: this pipe uses the Internationalization API which is not yet available in all browsers and may require a polyfill. See Browser Support for details.
linkExample
@Component({
selector: 'deprecated-percent-pipe',
template: `<div>
<!--output '25.9%'-->
<p>A: {{a | percent}}</p>
<!--output '0,134.95%'-->
<p>B: {{b | percent:'4.3-5'}}</p>
</div>`
})
export class DeprecatedPercentPipeComponent {
a: number = 0.259;
b: number = 1.3495;
}