Pipe

wrNumber

Locale-aware number formatting via Intl.NumberFormat. Uses Angular's LOCALE_ID. Accepts a style shortcut ('decimal' | 'percent' | 'currency') with optional currency code, or a full Intl.NumberFormatOptions object.

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" -->
1,234.5 · 9,876,543.21

Percent

Multiplies by 100 and appends the locale's percent sign.

{{ 0.875 | wrNumber: 'percent' }}  <!-- "88%" -->
87.5% · 4.1%

Currency

Pass the ISO 4217 code as the second argument.

{{ 19.99 | wrNumber: 'currency' : 'USD' }}  <!-- "$19.99" -->
$19.99 · €19.99 · UZS 250,000.00

Custom options

Anything Intl.NumberFormat understands — pass the options object directly.

{{ 19.9 | wrNumber: { minimumFractionDigits: 2 } }}      <!-- "19.90" -->
{{ 1234567 | wrNumber: { notation: 'compact' } }}        <!-- "1.2M"  -->
19.90 · 1.2M

Playground

$19.99

{{ 19.99 | wrNumber: 'currency' : 'USD' }}

Customize

Value
19.99
Style
Currency

API

NameDescriptionTypeDefault
wrNumberIntl.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