I noticed that there is a pipe called CurrencyPipe in Angular 2, which will filter some decimals from a number. This also adds the ISO currency indicator, ie \'USD\' or any othe
Create a new pipe that receive the currency as input.
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'space'
})
export class SpacePipe implements PipeTransform {
transform(value: any, args?: any): any {
console.log(value.substring(0, 1) + ' ' + value.substring( 1));
return value.substring(0, 1) + ' ' + value.substring( 1);
}
}
After that you can call them like this
{{discount | currency: 'EUR' | space}}
Dont forget to include it in @NgModule -> declarations