fix(common): export currencies via getCurrencySymbol (#20983)

PR Close #20983
This commit is contained in:
Olivier Combe
2017-12-13 15:16:05 +01:00
committed by Kara Erickson
parent 2fc4cf67be
commit fecf768f43
7 changed files with 34 additions and 18 deletions

View File

@ -8,7 +8,7 @@
import {Inject, LOCALE_ID, Pipe, PipeTransform} from '@angular/core';
import {formatNumber} from '../i18n/format_number';
import {NumberFormatStyle, findCurrencySymbol, getLocaleCurrencyName, getLocaleCurrencySymbol} from '../i18n/locale_data_api';
import {NumberFormatStyle, getCurrencySymbol, getLocaleCurrencyName, getLocaleCurrencySymbol} from '../i18n/locale_data_api';
import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
/**
@ -143,7 +143,7 @@ export class CurrencyPipe implements PipeTransform {
let currency = currencyCode || 'USD';
if (display !== 'code') {
currency = findCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow');
currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow');
}
const {str, error} = formatNumber(value, locale, NumberFormatStyle.Currency, digits, currency);