From ee39b66c4d5018c2a55da87168a56ce0794b570c Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 3 Jan 2025 00:10:11 +0530 Subject: [PATCH] fix: commentted UAE sepcific precision code --- frontend/src/utils/numberFormat.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/utils/numberFormat.js b/frontend/src/utils/numberFormat.js index 7ee2128f..b0fb3845 100644 --- a/frontend/src/utils/numberFormat.js +++ b/frontend/src/utils/numberFormat.js @@ -169,18 +169,18 @@ export function formatCurrency(value, format, currency = 'USD', precision = 2) { } // If you change anything below, it's going to hurt a company in UAE, a bit. - if (precision > 2) { - let parts = cstr(value).split('.') // should be minimum 2, comes from the DB - let decimals = parts.length > 1 ? parts[1] : '' // parts.length == 2 ??? + // if (precision > 2) { + // let parts = cstr(value).split('.') // should be minimum 2, comes from the DB + // let decimals = parts.length > 1 ? parts[1] : '' // parts.length == 2 ??? - if (decimals.length < 3 || decimals.length < precision) { - const fraction = 100 + // if (decimals.length < 3 || decimals.length < precision) { + // const fraction = 100 - if (decimals.length < cstr(fraction).length) { - precision = cstr(fraction).length - 1 - } - } - } + // if (decimals.length < cstr(fraction).length) { + // precision = cstr(fraction).length - 1 + // } + // } + // } format = getNumberFormat(format) let symbol = getCurrencySymbol(currency)