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
You can override the pipe as follows. Make sure you include this in the module
import {Pipe, PipeTransform} from "@angular/core";
import {CurrencyPipe} from "@angular/common";
@Pipe({name: 'currency'})
export class MyCurrencyPipe extends CurrencyPipe implements PipeTransform {
transform(value: any, currencyCode: string, symbolDisplay: boolean, digits: string): string {
const currencyFormat = super.transform(value, currencyCode, symbolDisplay, digits);
const firstDigit = currencyFormat.search(/\d/);
return currencyFormat.substring(0, firstDigit) + ' ' + currencyFormat.substr(firstDigit);
}
}