0

I have this code:

"ValorPesos" : 345224.2666860273

<td class="numberAlign-right">{{valorCuota.ValorPesos | currency:code:'CLP':'1.4-4'}}</td>

Current ouput: 34.5224,2667
What i want: 34.5224,2666

Is there any way that the number pipe do not approximate the number?

I didn't saw anything like that in Angular docs.

rfcabal
  • 121
  • 1
  • 4
  • 17
  • it's following standard rounding rules, if you want your own rounding rules, then put a custom roundDown pipe before the currency pipe. – bryan60 Nov 24 '17 at 15:57

1 Answers1

1

For a quick work around, you can increase the minFractionDigits and maxFractionDigits by 1 and slice the resultant string to exclude the last character by

unRoundedCurrency = roundedCurrency.slice(0, -1);

To accomplish this, you can create a function in component and return the resultant currency string from there, after applying angular's currency pipe using the method described below.

How to use angular pipe from component

abdul-wahab
  • 2,182
  • 3
  • 21
  • 35