Angular2: Currency Format

Posted by Unknown On Friday, July 14, 2017 0 comments

Format: {{cost | currency:'USD':true:'1.2-2'}}
Output: $348.64

  • Format: {{currency:currencyCode:symbolDisplay:digitInfo}}
  • CurrencyCode Info: https://en.wikipedia.org/wiki/ISO_4217
  • SymbolDisplay: is a boolean indicating whether to use the currency symbol or code.
        true: use symbol (e.g. $).
        false(default): use code (e.g. USD).
  • DigitInfo Format: {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
    •    1 : minIntegerDigits
    •    2 : minFractionDigits
    •    2 : maxFractionDigits

0 comments:

Post a Comment