fix: commentted UAE sepcific precision code

This commit is contained in:
Shariq Ansari 2025-01-03 00:10:11 +05:30
parent bf69df3580
commit ee39b66c4d

View File

@ -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 you change anything below, it's going to hurt a company in UAE, a bit.
if (precision > 2) { // if (precision > 2) {
let parts = cstr(value).split('.') // should be minimum 2, comes from the DB // let parts = cstr(value).split('.') // should be minimum 2, comes from the DB
let decimals = parts.length > 1 ? parts[1] : '' // parts.length == 2 ??? // let decimals = parts.length > 1 ? parts[1] : '' // parts.length == 2 ???
if (decimals.length < 3 || decimals.length < precision) { // if (decimals.length < 3 || decimals.length < precision) {
const fraction = 100 // const fraction = 100
if (decimals.length < cstr(fraction).length) { // if (decimals.length < cstr(fraction).length) {
precision = cstr(fraction).length - 1 // precision = cstr(fraction).length - 1
} // }
} // }
} // }
format = getNumberFormat(format) format = getNumberFormat(format)
let symbol = getCurrencySymbol(currency) let symbol = getCurrencySymbol(currency)