fix price format (default oman price)

This commit is contained in:
2026-01-14 22:33:07 +03:00
parent aaef1bc11b
commit 44e2730428
4 changed files with 146 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import React from "react";
import { useAppSelector } from "redux/hooks";
import ProText from "../ProText";
import { formatPriceUi } from "utils/helpers";
interface ArabicPriceProps {
price: number | string;
@@ -25,7 +26,8 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
const { restaurant } = useAppSelector((state) => state.order);
// Format the price to ensure it has 2 decimal places
const formattedPrice = typeof price === "number" ? price.toFixed(2) : price;
const formattedPrice =
typeof price === "number" ? formatPriceUi(price, 3) : price;
const { textDecoration, ...restStyle } = style;
const decorationStyle = textDecoration
? ({ textDecoration } as React.CSSProperties)

View File

@@ -15,6 +15,7 @@ import ProInputCard from "../ProInputCard/ProInputCard";
import styles from "./PaymentMethods.module.css";
import { OrderType } from "pages/checkout/hooks/types.ts";
import RCardIcon from "components/Icons/RCardIcon";
import { formatPriceUi } from "utils/helpers";
const PaymentMethods = () => {
const { t } = useTranslation();
@@ -48,7 +49,7 @@ const PaymentMethods = () => {
</>
),
value: "cash",
price: grandTotal.toFixed(2),
price: formatPriceUi(grandTotal, 3),
style: {
color: colors.primary,
},