0

I want to convert comma seperated string value to a number. The string value I am getting from DecimalPipe.transform() method. I want it to be in number so that I can use it in my calculation.

  const value = 123456789.789878;
  let res = this.decimalPipe.transform(value, '1.0-2');
  console.log(parseFloat(res.replace( /,/g, '' )));

I tried using + operator for typecasting. But it is resulting in NaN. Is there any other way to do that or with + operaton can I do that?

updated example stackblitz

IamGrooot
  • 940
  • 1
  • 17
  • 44

0 Answers0