feat: unify currency display to toman across the application
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { request } from "@/services/response";
|
||||
import { formatToman } from "@/lib/money";
|
||||
import Cookies from "js-cookie";
|
||||
import Layout from "@/components/layout";
|
||||
|
||||
@@ -95,9 +96,7 @@ export default function PaymentDetailsPage() {
|
||||
}).format(date);
|
||||
};
|
||||
|
||||
const formatAmount = (rials) => {
|
||||
return new Intl.NumberFormat("fa-IR").format(parseInt(rials));
|
||||
};
|
||||
const formatAmount = (rials) => formatToman(rials);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
@@ -153,7 +152,7 @@ export default function PaymentDetailsPage() {
|
||||
<div className="flex justify-between items-center py-3 border-b border-gray-100">
|
||||
<span className="text-[#616161] font-medium">مبلغ:</span>
|
||||
<span className="text-[#3B3B3B] font-bold text-lg">
|
||||
{formatAmount(payment.amount_rials)} ریال
|
||||
{formatAmount(payment.amount_rials)} تومان
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user