From 431f45fea26ec8a10cee17ffb9e2aad3a719c10a Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 20 Jun 2024 15:04:36 +0530 Subject: [PATCH] fix: pass currency in formatNumberIntoCurrency method --- frontend/src/utils/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index d0833229..104f66db 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -94,12 +94,12 @@ export function secondsToDuration(seconds) { return `${hours}h ${minutes}m ${_seconds}s` } -export function formatNumberIntoCurrency(value) { +export function formatNumberIntoCurrency(value, currency = 'INR') { if (value) { return value.toLocaleString('en-IN', { - maximumFractionDigits: 2, + maximumFractionDigits: 0, style: 'currency', - currency: 'INR', + currency: currency ? currency : 'INR', }) } return ''