feat: unify currency display to toman across the application

This commit is contained in:
hamed
2026-07-03 10:31:16 +03:30
parent 79f7df2e4d
commit 5bec4848a2
8 changed files with 116 additions and 12 deletions
+8
View File
@@ -0,0 +1,8 @@
// واحد API/درگاه ریال است؛ نمایش تومان (÷۱۰) و در صورت ورودی ×۱۰.
export const RIAL_PER_TOMAN = 10;
export const rialToToman = (rial) => Math.round((Number(rial) || 0) / RIAL_PER_TOMAN);
export const tomanToRial = (toman) => Math.round((Number(toman) || 0) * RIAL_PER_TOMAN);
// فرمت فارسیِ مبلغ تومان از مقدار ریالِ API.
export const formatToman = (rial) => rialToToman(rial).toLocaleString("fa-IR");