I have a Precision Pipe that gives me the desired precision number... However, that pipe does not use any other number formatting, like local thousand separator etc.
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'precision' })
export class PrecisionPipe implements PipeTransform {
transform(value: number | string, precision: number): string {
return typeof value === 'number' ? value.toFixed(precision) : value;
}
}
Is there a way to apply the 'number' pipe in my Precision pipe, to localize it?
Knowing that
> 444444.5.toFixed(2)
'444444.50'
// I need "444 444.50"
DecimalPipe
in thePrecisionPipe
through the constructor. – Breath