From 8a2b9407c8f5bba07661f7d3bb0ebd5849722c8a Mon Sep 17 00:00:00 2001 From: ajiragroup <108009061+ajiragroup@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:36:41 +0545 Subject: [PATCH] fix: Modified Number system for Nepal (#23613) * Update utils.js Further refined number system for Nepal. Numbering in Nepal does not continue as 100 Crores/1000 Crores as in India, but it proceeds as: -> 1 Arba for 100 Crore -> 1 Kharba for 100 Arba (10,000 Cr) * Update number_systems.js Added number system for Nepal. Numbering in Nepal does not continue as 100 Crores/1000 Crores as in India, but it proceeds as: -> 1 Arba for 100 Crore -> 1 Kharba for 100 Arba (10,000 Cr) * chore: simpler condition * style: format --------- Co-authored-by: Ankush Menat Co-authored-by: Ankush Menat --- .../public/js/frappe/utils/number_systems.js | 22 +++++++++++++++++++ frappe/public/js/frappe/utils/utils.js | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/utils/number_systems.js b/frappe/public/js/frappe/utils/number_systems.js index 8224f11d37..ee04dd8271 100644 --- a/frappe/public/js/frappe/utils/number_systems.js +++ b/frappe/public/js/frappe/utils/number_systems.js @@ -31,4 +31,26 @@ export default { symbol: __("K", null, "Number system"), }, ], + nepalese: [ + { + divisor: 1.0e11, + symbol: __("Kh", null, "Number system"), // 10^11 is read as 1 Kharba + }, + { + divisor: 1.0e9, + symbol: __("Ar", null, "Number system"), // 10^9 is read as 1 Arba + }, + { + divisor: 1.0e7, + symbol: __("Cr", null, "Number system"), + }, + { + divisor: 1.0e5, + symbol: __("L", null, "Number system"), + }, + { + divisor: 1.0e3, + symbol: __("K", null, "Number system"), + }, + ], }; diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index e94452da4e..02305870cd 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -1170,8 +1170,10 @@ Object.assign(frappe.utils, { }, get_number_system: function (country) { - if (["Nepal", "Bangladesh", "India", "Myanmar", "Pakistan"].includes(country)) { + if (["Bangladesh", "India", "Myanmar", "Pakistan"].includes(country)) { return number_systems.indian; + } else if (country == "Nepal") { + return number_systems.nepalese; } else { return number_systems.default; }