mirror of
https://github.com/samnyan/aqua-viewer.git
synced 2026-04-26 01:19:53 -05:00
17 lines
323 B
TypeScript
17 lines
323 B
TypeScript
import {Pipe, PipeTransform} from '@angular/core';
|
|
|
|
@Pipe({
|
|
name: 'formatNumber'
|
|
})
|
|
export class FormatnumberPipe implements PipeTransform {
|
|
|
|
public transform(value: number, length?: number): string {
|
|
let str = value.toString();
|
|
while (str.length < length) {
|
|
str = '0' + str;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
}
|