From 4ff84cdf1179e303525dcffed63a451d4cf5be53 Mon Sep 17 00:00:00 2001 From: Trevin Chow Date: Sat, 20 Jan 2024 20:58:01 -0800 Subject: [PATCH] feat: add support for Bulgarian Lev (BGN) and Croatian Kuna (HRK) currency --- lib/currency-locales/locales/bg.yml | 22 +++++++++++++++++++ lib/currency-locales/locales/hr.yml | 22 +++++++++++++++++++ lib/currency-locales/locales/ngn.yml | 26 ----------------------- spec/integration/currency_locales_spec.rb | 3 ++- 4 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 lib/currency-locales/locales/bg.yml create mode 100644 lib/currency-locales/locales/hr.yml delete mode 100644 lib/currency-locales/locales/ngn.yml diff --git a/lib/currency-locales/locales/bg.yml b/lib/currency-locales/locales/bg.yml new file mode 100644 index 0000000..10cd5bc --- /dev/null +++ b/lib/currency-locales/locales/bg.yml @@ -0,0 +1,22 @@ +bg: + number: + format: + precision: 2 + separator: "," + delimiter: " " + + currency: + format: + unit: 'лв' + precision: 2 + format: '%n%u' + separator: "," + delimiter: " " + + percentage: + format: + delimiter: " " + + precision: + format: + delimiter: " " diff --git a/lib/currency-locales/locales/hr.yml b/lib/currency-locales/locales/hr.yml new file mode 100644 index 0000000..7e3182f --- /dev/null +++ b/lib/currency-locales/locales/hr.yml @@ -0,0 +1,22 @@ +hr: + number: + format: + precision: 2 + separator: "," + delimiter: "." + + currency: + format: + unit: 'kn' + precision: 2 + format: '%n %u' + separator: "," + delimiter: "." + + percentage: + format: + delimiter: "." + + precision: + format: + delimiter: "." diff --git a/lib/currency-locales/locales/ngn.yml b/lib/currency-locales/locales/ngn.yml deleted file mode 100644 index af13641..0000000 --- a/lib/currency-locales/locales/ngn.yml +++ /dev/null @@ -1,26 +0,0 @@ -ngn: - number: - format: - separator: "." - delimiter: "," - precision: 2 - significant: false - strip_insignificant_zeros: false - - currency: - format: - format: "%u%n" - unit: "₦" - separator: "." - delimiter: "," - precision: 2 - significant: false - strip_insignificant_zeros: false - - percentage: - format: - delimiter: "" - - precision: - format: - delimiter: "," diff --git a/spec/integration/currency_locales_spec.rb b/spec/integration/currency_locales_spec.rb index 03ca3bf..16a9116 100755 --- a/spec/integration/currency_locales_spec.rb +++ b/spec/integration/currency_locales_spec.rb @@ -34,6 +34,7 @@ def number_with_precision(number) locales = { 'ae' => ['AED 9.99', 'AED 9,999.99', '9.99', '9,999.99'], + 'bg' => ['9,99лв', '9 999,99лв', '9,99', '9 999,99'], 'cs' => ['9,99Kč', '9999,99Kč', '9,99', '9999,99'], 'da' => ['9,99kr', '9.999,99kr', '9,99', '9.999,99'], 'en-AU' => ['$9.99', '$9,999.99', '9.99', '9,999.99'], @@ -44,12 +45,12 @@ def number_with_precision(number) 'es-MX' => ['$9.99', '$9,999.99', '9.99', '9,999.99'], 'eu' => ['€9.99', '€9,999.99', '9.99', '9,999.99'], 'gsw-CH' => ['CHF9.99', 'CHF9,999.99', '9.99', '9,999.99'], + 'hr' => ['9,99 kn', '9.999,99 kn', '9,99', '9.999,99'], 'hu' => ['10Ft', '10000Ft', '9,99', '9999,99'], 'il' => ['₪9.99', '₪9,999.99', '9.99', '9,999.99'], 'ja' => ['¥10', '¥10,000', '9.99', '9,999.99'], 'ms-MY' => ['RM9.99', 'RM9,999.99', '9.99', '9,999.99'], 'nb' => ['9,99 kr', '9999,99 kr', '9,99', '9999,99'], - 'ngn' => ['₦9.99', '₦9,999.99', '9.99', '9,999.99'], 'pl' => ['9,99 zł', '9999,99 zł', '9,99', '9999,99'], 'pt-BR' => ['R$9,99', 'R$9.999,99', '9,99', '9.999,99'], 'ro' => ['9,99 RON', '9.999,99 RON', '9,99', '9.999,99'],