human_number 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e0d600c4f0ff53b38dcd26865c3b55ef28f3a2f22e3ea69cdea9e22b8f81a41
4
- data.tar.gz: 8da74420bb439d1d5ccc331d9e96b6c0936aefe2f9b5e2df3762201bd5745198
3
+ metadata.gz: f3e4c992501e9303d1d288b507757e305bbf1cd148322bb5d23046f3ca9a5703
4
+ data.tar.gz: 74b84f6b21e5e4d7b869f81f4ee41a1f090be8884c07f0d58fb113029afde5de
5
5
  SHA512:
6
- metadata.gz: 3a2f779396168c7519591e82e4c79358cd84143dea4c8665e13a16d71ed946b9dc2b7d0790daeaac52b083e1c45c13f767910ca498b36f2943fd6e3be1ead350
7
- data.tar.gz: ac05daeca413e08338aec8b0776accee0abdb3ecfad05cab004d83c31084d4f9faec622e6069d7578256c801882311c6e2f2e64bdaf425711d358ace7339cc1b
6
+ metadata.gz: c8204b1d746ffda09e0973bc49d7418bbfb5a3355c791839a1afc6f22e2332de1fe9ceb44eee744f92d10d7e15f0e883d3ea8c1b1d171119c84e345160a1b14b
7
+ data.tar.gz: 4cf5346df66b1dfb6143dec1c61db38532bb172bf9a56fddc0700531941de333292081c7431fe1799e900723289947ef10b35d48252657efef9ec76fba6b6419
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
1
+ --format progress
2
+ --require spec_helper
@@ -20,11 +20,8 @@ module HumanNumber
20
20
  def format(formatted_number, currency_code:, locale:)
21
21
  locale = locale.to_sym
22
22
 
23
- # Use shared locale logic to determine display locale
24
- display_locale = HumanNumber::LocaleSupport.primary_locale_for_currency(currency_code, locale)
25
-
26
- # Apply currency formatting to the already formatted number
27
- apply_currency_formatting(formatted_number, currency_code, display_locale)
23
+ # Apply currency formatting using user's locale to determine native vs non-native display
24
+ apply_currency_formatting(formatted_number, currency_code, locale)
28
25
  end
29
26
 
30
27
  private
@@ -113,12 +113,15 @@ module HumanNumber
113
113
  # Return nil for unknown currencies so formatters can fall back appropriately
114
114
  return nil if native_locales_for_currency(currency_code).empty?
115
115
 
116
+ # For native locales, use native currency formatting (native_unit, native_format)
116
117
  if SUPPORTED_NATIVE_CURRENCY_KEYS.include?(key) && native_locale?(currency_code, locale)
117
118
  native_key = native_currency_key(key)
118
119
 
119
120
  return I18n.t(native_key, locale:) if I18n.exists?(native_key, locale)
120
121
  end
121
122
 
123
+ # For non-native locales or standard keys, always use the currency's native locale
124
+ # This ensures we get the correct currency symbol regardless of user's locale
122
125
  I18n.t(currency_key(key), locale: primary_locale_for_currency(currency_code, locale))
123
126
  end
124
127
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HumanNumber
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ether Moon