UNPKG

@jsverse/transloco-locale

Version:

The localization (l10n) library plugin for Transloco

23 lines (22 loc) 1.26 kB
import { PipeTransform } from '@angular/core'; import { Currency, Locale, NumberFormatOptions } from '../transloco-locale.types'; import { BaseLocalePipe } from './base-locale.pipe'; import * as i0 from "@angular/core"; export declare class TranslocoCurrencyPipe extends BaseLocalePipe implements PipeTransform { private localeConfig; /** * Transform a given number into the locale's currency format. * * @example * * 1000000 | translocoCurrency: 'symbol' : {} : USD // $1,000,000.00 * 1000000 | translocoCurrency: 'name' : {} : USD // 1,000,000.00 US dollars * 1000000 | translocoCurrency: 'symbol' : {minimumFractionDigits: 0 } : USD // $1,000,000 * 1000000 | translocoCurrency: 'symbol' : {minimumFractionDigits: 0 } : CAD // CA$1,000,000 * 1000000 | translocoCurrency: 'narrowSymbol' : {minimumFractionDigits: 0 } : CAD // $1,000,000 * */ transform(value: number | string, display?: 'code' | 'symbol' | 'narrowSymbol' | 'name', numberFormatOptions?: NumberFormatOptions, currencyCode?: Currency, locale?: Locale): string; static ɵfac: i0.ɵɵFactoryDeclaration<TranslocoCurrencyPipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<TranslocoCurrencyPipe, "translocoCurrency", true>; }