fix(common): remove trailing whitespace for CurrencyPipe (#34642)

Trimming any surrounding whitespace characters informatNumberToLocaleString
if currency symbol issupressed.

Closes #34641

PR Close #34642
This commit is contained in:
Troels Lenda
2020-01-05 21:33:30 +01:00
committed by Alex Rickabaugh
parent 17801c3076
commit c42b90b81d
2 changed files with 11 additions and 1 deletions

View File

@ -161,7 +161,12 @@ export function formatCurrency(
return res
.replace(CURRENCY_CHAR, currency)
// if we have 2 time the currency character, the second one is ignored
.replace(CURRENCY_CHAR, '');
.replace(CURRENCY_CHAR, '')
// If there is a spacing between currency character and the value and
// the currency character is supressed by passing an empty string, the
// spacing character would remain as part of the string. Then we
// should remove it.
.trim();
}
/**