0

I have this code:

.TS

export class AppComponent implements OnInit  {

myPrice : number;

ngOnInit(): void {
  this.myPrice = 99999999999999.9999;  
}

.HTML

<p>{{myPrice | currency:'EUR':'symbol':'1.4-4':'it'}}</p>

the result is 100.000.000.000.000,0000 €

I need to display precisely the value of the variable myPrice

It seems that the currency pipe does not work properly.

Is there some workaround that I can use?

slacky82
  • 342
  • 4
  • 11

1 Answers1

1

You might be better using something like bignumber.js - there are limitations to native JavaScript number precision and size, and that library also handles formatting

Drenai
  • 11,315
  • 9
  • 48
  • 82