10 lines
375 B
JavaScript
10 lines
375 B
JavaScript
const t = (n) => n == null || n === "" ? "" : new Intl.NumberFormat("fa-IR").format(Number(n)), e = (n) => n == null ? "" : String(n).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), i = (n) => n == null ? "" : String(n).replace(
|
||
/[۰-۹]/g,
|
||
(r) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(r))
|
||
);
|
||
export {
|
||
i as toEnDigits,
|
||
e as toFaDigits,
|
||
t as toFaNumber
|
||
};
|