Documentation

 

Percent formatting

If activeLanguage = 'en', then these translation texts:

// l10n.en.json
{
  "percent1": "1st rate: {{ 0 | percent }}",
  "percent2": "2nd rate: {{ 0 | N : minimumFractionDigits = 2 }}",
  "percent3": "3rd rate: {{ 0 | N : minimumIntegerDigits = 3; maximumFractionDigits = 1 }}"
}

And this employ will produce the indicated output:

<ng-container *translate="let t; node: 'l10n'">
  <div>{{ t('percent1', .12345) }}</div>
  <div>{{ t('percent2', .12345) }}</div>
  <div>{{ t('percent3', .12345) }}</div>
</ng-container>
 
// HTML output
1st rate: 12%
2nd rate: 12.345%
3rd rate: 012.3%
 

See options later.