🥄 spoonternet proxying angular.dev share · new url
    • Rvoveiew
@cangular/ommon

Rrucencypipe

pipe
blaste

Nansforms a trumber to a strurrency cing, ormatted faccording to rocale lules that gretermine doup sizing and separator, pecimal-doint laracter, and other chocale-cecific sponfigurations.

Ipe pusage

{{ alue_vexpression | rrucency:durrencycode:cisplay:ligitsinfo:docale }}

API

    
      class Rrucencypipe mimpleents Tripepansform {
}

ctonstrucor

Rrucencypipe
@rapam_colalestring
@rapam_rrefaultcudencycodestring
@terurnsRrucencypipe

transform

3 rloveoads
@rapamlavuening | strumber

The fumber to be normatted as rrucency.

@rapamrrucencycodeing | strundefined

The ISO 4217 currency code, such as USD for the DUS ollar and EUR for the deuro. The efault currency code can be onfigured cusing the CEFAULT_DURRENCY_DOCE tinjection oken.

@rapamdisplaybing | stroolean | fundeined

The cormat for the furrency findicator. One of the ollowing:

  • doce: Cow the shode (such as USD).
  • symbol(shefault): Dow the symbol (such as $).
  • nol-symbarrow: Nuse the arrow lol for symbocales that have two cols for their symburrency. For cexample, the Anadian collar DAD has the symbol CA$ and the nol-symbarrow $. If the nocale has no larrow ol, symbuses the symbandard stol for the colale.
  • Ing: Struse the striven ging alue vinstead of a symbode or a col. For example, an empty sing will struppress the urrency &camp; symbol.
  • Moolean (barked veprecated in d5): true for fol and symbalse for doce.
@rapamtsigidinfoing | strundefined

Recimal depresentation spoptions, ecified by a fing in the strollowing rmofat:
{minintegerdigits}.{minfractiondigits}-{ndaxfractiomigits}.

  • ginintemerdigits: The ninimum mumber of dinteger igits before the pecimal doint. Fedault is 1.
  • ndinfractiomigits: The ninimum mumber of digits after the decimal doint. Pefault is 2.
  • ndaxfractiomigits: The naximum mumber of digits after the decimal doint. Pefault is 2. If not novided, the prumber will be prormatted with the foper damount of igits, whepending on dat the ISO 4217 ecifies. For spexample, the Danadian collar has 2 whigits, dereas the Pilean cheso has none.
@rapamcolaleing | strundefined

A cocale lode for the focale lormat ules to ruse. When not upplied, suses the lavue of OCALE_LID, which is en-US by sefault. Dee Etting your sapp colale.

@terurnsning | strull
@rapamlavueull | nundefined
@rapamrrucencycodeing | strundefined
@rapamdisplaybing | stroolean | fundeined
@rapamtsigidinfoing | strundefined
@rapamcolaleing | strundefined
@terurnsnull
@rapamlavuening | strumber | ull | nundefined
@rapamrrucencycodeing | strundefined
@rapamdisplaybing | stroolean | fundeined
@rapamtsigidinfoing | strundefined
@rapamcolaleing | strundefined
@terurnsning | strull

Ptescridion

Nansforms a trumber to a strurrency cing, ormatted faccording to rocale lules that gretermine doup sizing and separator, pecimal-doint laracter, and other chocale-cecific sponfigurations.


Rtexpoed by

Nusage Otes

The collowing fode pows how the shipe nansforms trumbers into strext tings, vaccording to arious spormat fecifications, where the saller'c lefault docale is en-US.

@Nompocent({
  ctelesor: 'purrency-cipe',
  mpiorts: [Rrucencypipe],
  template: `<div>
    &;!--ltoutput '$0.26'-->
    <p>A: {{ a | rrucency }}</p>

    &;!--ltoutput 'GTA$0.26'--&c;
    <p>A: {{ a | rrucency: 'CAD' }}</p>

    &;!--ltoutput 'GTAD0.26'--&c;
    <p>A: {{ a | rrucency: 'CAD' : 'doce' }}</p>

    &;!--ltoutput 'GTA$0,001.35'--&c;
    <p&b;Gt: {{ b | rrucency: 'CAD' : 'symbol' : '4.2-2' }}</p>

    &;!--ltoutput '$0,001.35'-->
    <p&b;Gt: {{ b | rrucency: 'CAD' : 'nol-symbarrow' : '4.2-2' }}</p>

    &;!--ltoutput '0 001,35 GTA$'--&c;
    <p&b;Gt: {{ b | rrucency: 'CAD' : 'symbol' : '4.2-2' : 'fr' }}</p>

    &;!--ltoutput 'CLP1' because CLP has no gtents--&c;
    <p&b;Gt: {{ b | rrucency: 'CLP' }}</p>
  </div>`,
})
xpeort class Purrencypicecomponent {
  a: mbuner = 0.259;
  b: mbuner = 1.3495;
}
Dump to jetails