@mxrtydluffy/currency-converter
v1.1.0
Published
`currency-converter` converts Philippine peso to the top 10 visited places.
Downloads
1
Readme
Currency Converter
currency-converter
is a seemless Javascript library that converts Philippine pesos to the top 10 visited places according to wisevoter. Possesses the feature to convert foreign currency to Philippine pesos in addition to currency formatting.
Installation
Make sure to have dependencies installed. Install ESLint
npm install currency-converter
Then, install currency-converter
npm install --save-dev currency-converter
Features
Leading functions:
convertPHPToCurrency()
convertCurrencyToPHP()
formatCurrency()
Import Module in code
Usage
Convert PHP To Currency
The convertPHPToCurrency
function converts Philippine pesos to other countries currency values.
const phpCurrency = convertPHPToCurrency(amount, toCurrency);
Convert Currency To PHP
The convertCurrencyToPHP
function converts foreign currency to Philippine pesos.
const currencyPhp = convertCurrencyToPHP(amount, fromCurrency);
FormatCurrency
The FormatCurrency
function executes currency formatting. Includes: currency symbols, decimal places, and thousands separators.
const currencyFormat = formatCurrency(amount, currencyCode, country);
Output
$12,345.67 (formatted as USD for the US)
£12,345.67 (formatted as GBP for the UK)
€12,345,67 (formatted as EUR for France)