kwn / number-to-words

Number to string standalone PHP library with i18n. Drivers for numbers and currency included.
MIT License
375 stars 155 forks source link

Enhancement: Automatically Set Default Currency Based on Locale #178

Open ngekoding opened 3 months ago

ngekoding commented 3 months ago

Problem

Currently, we need to manually define a currency identifier even when a specific locale is already set. This seems redundant and could lead to potential errors or inconsistencies.

Proposal

Could we simplify this process by using the default currency associated with the specified locale? For instance, when the locale is set to Indonesian (id), the default currency should automatically be Indonesian Rupiah (IDR).

Thank you for considering this enhancement!

kwn commented 3 months ago

I see a very little value in having implicit currency based on the locale, as it only applies for the languages that are used in one country.

What would be the default currency for English language? Should it be US Dollar, British Pound or Australian Dollar? For German language - Euro or Swiss Frank? For Spanish - Euro, Mexican Peso or Argentinian Peso?

I think having a default currency introduces more confusion in that case.