close

 

http://bioankeyang.blogspot.com/2014/04/jsjavascript.html

 

 

import { Pipe, PipeTransform } from '@angular/core';
// export enum PipeParm {
// CompileStatus = 'CompileStatus',
// CompilePGType = 'CompilePGType',
// YN2Boolean = 'YN2Boolean'
// }
@Pipe({ name: 'thousand' })
export class ThousandPipe implements PipeTransform {
bol: Boolean;
transform(number): any {
let num = number.toString();
const pattern = /(-?\d+)(\d{3})/;
while (pattern.test(num)) {
num = num.replace(pattern, '$1,$2');
}
return num;
}
}


arrow
arrow
    全站熱搜
    創作者介紹

    Chill_Radio 發表在 痞客邦 留言(0) 人氣()