Formats a number as percentage according to locale rules.
查看"说明"...
{{ value_expression | percent [ : digits ] }}
{{ value_expression | percent [ : digits ] }}
NgModule 参数 digits
string
可选. 默认值是 undefined
.
说明 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.
使用说明 Example @
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; }
content_copy
@ 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 ; }