How to format number


#1

How to format number
exemple :
3850 —> 3 850
215800 --> 215 800


#2

if you want show with comma separator use here code

{{model.Sallary | number : fractionSize}}

after model use | number : fractionSize

but if you want use space separator you must define pipe


#3

thankyou !!
but How to define pipes ?


#4

like here code

import {Pipe} from ‘@angular/core’

@Pipe({
name: ‘seperatorWitSpace’
})
export class SeperatorWitSpacePipe {
transform(value: number, args: string[]): string {
//seperate number and return this
}
}

and for use in html file like here

 <span> {{item.Sallary | seperatorWitSpace}} </span>

#5

Sorry , I do not understand


#6

read this