brick / money

A money and currency library for PHP
MIT License
1.65k stars 102 forks source link

Missing a few country currencies #67

Closed Marcin-TA closed 2 years ago

Marcin-TA commented 2 years ago

Hi!

I noticed you are missing a few country currencies. The list is significant, see below:

Bulgarian Lev (OLD),BGL
Cyprus Pound,CYP
Czechoslovakian Koruna,CSK
Ecuador Sucre,ECS
Estonian Kroon,EEK
Finnish Markka,FIM
Central Pacific Franc,CFP
German Mark,DEM
Greek Drachma,GRD
Italian Lira,ITL
Irish Punt,IEP
Italian Lira,ITL
Latvian Lats,LVL
Lithuanian Litas,LTL
Luxembourg Franc,LUF
Malagasy Franc,MGF
Maltese Lira,MTL
Mauritanian Ouguiya,MRO
Mozambique Metical,MZM
Dutch Guilder,NLG
Central Pacific Franc,CFP
Portuguese Escudo,PTE
Romanian Leu,ROL
Italian Lira,ITL
Sao Tome/Principe Dobra,STD
Slovak Koruna,SKK
Slovenian Tolar,SIT
Spanish Peseta,ESP
Sudanese Pound,SDP
Sudanese Dinar,SDD
Suriname Guilder,SRG
Turkish Lira,TRL
Turkmenistan Manat,TMM
Uganda Shilling,UGS
Venezuelan Bolivar,VEB
Central Pacific Franc,CFP
Spanish Peseta,ESP
Yugoslav Dinar,YUN
Zambian Kwacha,ZMK
Zimbabwe Dollar,ZWD
BenMorel commented 2 years ago

Hi, was this a mistake?

Marcin-TA commented 2 years ago

Hi, not really. Some of the country's currency IOS is still missing.

BenMorel commented 2 years ago

Hi, a quick search shows that the currencies you list are not in use anymore.

They're not part of the official ISO currency list, that's why they're not included in this project.

You may still use them by creating a Currency instance, though!

Marcin-TA commented 1 year ago

Hi Ben! Good idea with new Currency instance. Is that gonna be sth like new Currency('TES', 1234, 'TEST', 12344); ?

BenMorel commented 1 year ago

Yes, but only if you want 12344 decimal digits :slightly_smiling_face:

As per the docs:

use Brick\Money\Currency;
use Brick\Money\Money;

$bitcoin = new Currency(
    'XBT',     // currency code
    0,         // numeric currency code, useful when storing monies in a database; set to 0 if unused
    'Bitcoin', // currency name
    8          // default scale
);