PercentPipe

export class PercentPipe

exported from angular2/common defined in angular2/src/common/pipes/number_pipe.ts (line 94)

WARNING: this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera browsers.

Formats a number as local percent.

Usage

expression | percent[:digitInfo]

For more information about digitInfo see DecimalPipe

Example

@Component({ selector: 'percent-example', template: `<div> <p>A: {{a | percent}}</p> <p>B: {{b | percent:'4.3-5'}}</p> </div>` }) export class PercentPipeExample { a: number = 0.259; b: number = 1.3495; }

Annotations

@Pipe({name: 'percent'})

@Injectable()


Members

transform(value: any, args: any[]) : string

Not Yet Documented