Skip to content

Commit

Permalink
fix: Modified Number system for Nepal (#23613) (#23634)
Browse files Browse the repository at this point in the history
* 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 <ankushmenat@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 8a2b940)

Co-authored-by: ajiragroup <108009061+ajiragroup@users.noreply.github.com>
  • Loading branch information
mergify[bot] and ajiragroup committed Dec 6, 2023
1 parent 1afc1de commit 29ef929
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions frappe/public/js/frappe/utils/number_systems.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
],
};
4 changes: 3 additions & 1 deletion frappe/public/js/frappe/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,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;
}
Expand Down

0 comments on commit 29ef929

Please sign in to comment.