Download the PHP package chandachewe/currency without Composer
On this page you can find all versions of the php package chandachewe/currency. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chandachewe/currency
More information about chandachewe/currency
Files in chandachewe/currency
Package currency
Short Description A PHP Package to convert amount from one currency to the other
License MIT
Informations about the package currency
Currency
A PHP Package to convert Amount from one currency to the other.
Requirements
- PHP >= 7.3
Installation
Install currency using composer require
:
Enter the currency directory and run the following code
Add the namespaces and vendor/autoload in the file you will be doing your conversions from. Am assuming the file and the vendor are both in the root directory. In your file include the following on top:
Usage
Convert Amount from One Currency to the other
You can convert the amount from one currency to the other using the following code:
Important: See the supported currency formats below. Use of unsupported formats will throw an exception
Suppose I want to convert 10 USD to GBP then my code will be:
Then you can retrieve the result as follows:
Obtain the Exchange rate between two currencies
You can also obtain the exchange rates between two currencies as follows:
Suppose I want to obtain the exchange rate between 1 USD and the GBP then my code will be as follows:
Then you can retrieve the result as follows:
Drivers
Available Drivers
Versioning
Releases will be numbered with the following format:
Supported Currency Formats
- AED
- AFN
- ALL
- AMD
- ANG
- AOA
- ARS
- AUD
- AWG
- AZN
- BAM
- BBD
- BDT
- BGN
- BHD
- BIF
- BMD
- BND
- BOB
- BRL
- BSD
- BTC
- BTN
- BWP
- BYN
- BZD
- CAD
- CDF
- CHF
- CLF
- CLP
- CNH
- CNY
- COP
- CRC
- CUC
- CUP
- CVE
- CZK
- DJF
- DKK
- DOP
- DZD
- EGP
- ERN
- ETB
- EUR
- FJD
- FKP
- GBP
- GEL
- GGP
- GHS
- GIP
- GMD
- GNF
- GTQ
- GYD
- HKD
- HNL
- HRK
- HTG
- HUF
- IDR
- ILS
- IMP
- INR
- IQD
- IRR
- ISK
- JEP
- JMD
- JOD
- JPY
- KES
- KGS
- KHR
- KMF
- KPW
- KRW
- KWD
- KYD
- KZT
- LAK
- LBP
- LKR
- LRD
- LSL
- LYD
- MAD
- MDL
- MGA
- MKD
- MMK
- MNT
- MOP
- MRU
- MUR
- MVR
- MWK
- MXN
- MYR
- MZN
- NAD
- NGN
- NIO
- NOK
- NPR
- NZD
- OMR
- PAB
- PEN
- PGK
- PHP
- PKR
- PLN
- PYG
- QAR
- RON
- RSD
- RUB
- RWF
- SAR
- SBD
- SCR
- SDG
- SEK
- SGD
- SHP
- SLL
- SOS
- SRD
- SSP
- STD
- STN
- SVC
- SYP
- SZL
- THB
- TJS
- TMT
- TND
- TOP
- TRY
- TTD
- TWD
- TZS
- UAH
- UGX
- USD
- UYU
- UZS
- VES
- VND
- VUV
- WST
- XAF
- XAG
- XAU
- XCD
- XDR
- XOF
- XPD
- XPF
- XPT
- YER
- ZAR
- ZMW
- ZWL