I have to display Euro currency like this : 583 €
.
But with this code:
{{ price | currency:\'EUR\':true }}
I get
Honestly, I couldn't find any in-built way to do it. So created custom pipe called split.
working Demo: http://plnkr.co/edit/KX7hfaV2i7CX2VFobM8R?p=preview
import{Component,provide,Pipe,PipeTransform} from '@angular/core';
@Pipe({name:'split'})
export class ShiftPosition implements PipeTransform {
transform(items: any[], value: string): string {
return items.substr(1)+' ' +items.substr(0,1);
}
}
@Component({
selector:"my-app",
template:`
Dashboard
{{price|currency:'EUR':true|split:price}}
`
})
export class AppComponent{
price=10;
}