Import
import { WrNumber } from 'ngwr/pipes';
@Component({ imports: [WrNumber] })
export class MyComponent { /* ... */ }Decimal
Default style — grouped digits in the active locale.
{{ 1234.5 | wrNumber }} <!-- "1,234.5" -->Percent
Multiplies by 100 and appends the locale's percent sign.
{{ 0.875 | wrNumber: 'percent' }} <!-- "88%" -->Currency
Pass the ISO 4217 code as the second argument.
{{ 19.99 | wrNumber: 'currency' : 'USD' }} <!-- "$19.99" -->Custom options
Anything Intl.NumberFormat understands — pass the options object directly.
{{ 19.9 | wrNumber: { minimumFractionDigits: 2 } }} <!-- "19.90" -->
{{ 1234567 | wrNumber: { notation: 'compact' } }} <!-- "1.2M" -->Playground
$19.99
{{ 19.99 | wrNumber: 'currency' : 'USD' }}Customize
Value 19.99
Style
Currency
API
| Name | Description | Type | Default |
|---|---|---|---|
wrNumber | Intl.NumberFormat via Angular's LOCALE_ID. Accepts a style shortcut or full options object. | (value: number | string | null | undefined, styleOrOptions: WrNumberStyle | Intl.NumberFormatOptions = 'decimal', currency = 'USD') => string | — |