HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/shahnamag/front-end/src/app/pipes/fa.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'fa'
})
export class FaPipe implements PipeTransform {

  transform(str: any): string {
    if(typeof str == 'number') str = `${str}`;
    else if(!str) str = '';
    return str
      .replace(/0/g, '۰')
      .replace(/1/g, '۱')
      .replace(/2/g, '۲')
      .replace(/3/g, '۳')
      .replace(/4/g, '۴')
      .replace(/5/g, '۵')
      .replace(/6/g, '۶')
      .replace(/7/g, '۷')
      .replace(/8/g, '۸')
      .replace(/9/g, '۹')
      ;
  }

}