From f7a1bef554c58972b15e0c44853bb25393e75bc8 Mon Sep 17 00:00:00 2001 From: ariari04 Date: Wed, 18 Sep 2024 17:17:17 +0600 Subject: [PATCH] Sum format function --- package-lock.json | 11 ----------- package.json | 1 - src/entities/TenderCard.tsx | 9 ++++++++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b328c70..428dc0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.52.2", - "react-number-format": "^5.4.2", "react-toastify": "^10.0.5", "sass": "^1.77.8", "tailwind-merge": "^2.5.2", @@ -4226,16 +4225,6 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, - "node_modules/react-number-format": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.2.tgz", - "integrity": "sha512-cg//jVdS49PYDgmcYoBnMMHl4XNTMuV723ZnHD2aXYtWWWqbVF3hjQ8iB+UZEuXapLbeA8P8H+1o6ZB1lcw3vg==", - "license": "MIT", - "peerDependencies": { - "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/react-toastify": { "version": "10.0.5", "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", diff --git a/package.json b/package.json index 28fc178..1969e2e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.52.2", - "react-number-format": "^5.4.2", "react-toastify": "^10.0.5", "sass": "^1.77.8", "tailwind-merge": "^2.5.2", diff --git a/src/entities/TenderCard.tsx b/src/entities/TenderCard.tsx index b56042c..d5ad394 100644 --- a/src/entities/TenderCard.tsx +++ b/src/entities/TenderCard.tsx @@ -30,6 +30,12 @@ const TenderCard: React.FC = ({ plan_summ_decimal, address_of_organization, }: Props) => { + function formatNumber(value: string) { + return new Intl.NumberFormat("ru-RU", { + style: "decimal", + useGrouping: true, + }).format(parseInt(value)); + } return (
@@ -51,9 +57,10 @@ const TenderCard: React.FC = ({

Планируемая сумма

+ <p className="text-[14px] leading-6 mb-4"> Окончание приема заявок: {date_of_offer_datetime.slice(0, 10)} </p>