davidvandertuijn / number_format_currency
Number Format Currency
4.2
2022-04-04 12:10 UTC
Requires
- php: >=7.1.0
README
The “Number Format Currency” tool is designed to assist users in formatting numerical values as currency, enhancing the clarity and professionalism of financial data presentations. This functionality is essential for businesses, accountants, and analysts who need to display monetary amounts accurately and consistently.
Install
composer require davidvandertuijn/number_format_currency
Usage
number_format_currency('1234.56', 2, 'EUR'); // 1.234,56 number_format_currency('1234.56', 2, 'USD'); // 1,234.56
Support for the currencies below:
Country | Currency | Abbreviation/Code |
---|---|---|
Argentina | Argentine Peso | ARS |
Australia | Australian Dollar | AUD |
Brazil | Brazilian Real | BRL |
Chile | Chilean Peso | CLP |
China | Yuan Renminbi | CNY |
Columbia | Colombian Peso | COP |
Czech Republic | Czech Koruna | CZK |
Denmark | Danish Krone | DKK |
European Union | Euro | EUR |
Hong Kong | Hong Kong Dollar | HKD |
Hungary | Hungarian Forint | HUF |
India | Indian Rupee | INR |
Israel | New Israeli Shekel | ILS |
Japan | Yen | JPY |
Korea, Republic of | Won | KRW |
Malaysia | Malaysian Ringgit | MYR |
Mexico | Mexican Peso | MXN |
Morocco | Moroccan Dirham | MAD |
New Zealand | New Zealand Dollar | NZD |
Norway | Norwegian Krone | NOK |
Philippines | Philippine Peso | PHP |
Poland | Zloty | PLN |
Russian Federation | Russian Ruble | RUB |
Saudi Arabia | Saudi Riyal | SAR |
Singapore | Singapore Dollar | SGD |
South Africa | Rand | ZAR |
Sweden | Swedish Krona | SEK |
Switzerland | Swiss Franc | CHF |
Taiwan | New Taiwan Dollar | TWD |
Thailand | Baht | THB |
Turkey | Turkish Lira | TRY |
UK/Great Britain | Pound Sterling | GBP |
United States | US Dollar | USD |
Vietnam | Dong | VND |
English or French Notation
number_format_currency('1234.56', 2, 'CAD', 'English'); // 1,234.56 number_format_currency('1234.56', 2, 'CAD', 'French'); // 1 234,56