him-ich-currency-converter
A piece of code that do the currency converter.
Installation
Using npm:
npm install him-ich-currency-converter
fromUSDToCustomAsset(usd_amount, per_usd)
Convert the amount in USD to the other amount of Custom Asset on Stellar
var fromUSDToCustomAsset = ; const usd_amount = 2; // $const per_usd = 40; // 1$ == 40 console; // 80
fromUSDToKHR(usd_amount, per_usd = 4000)
Convert the amount in USD to KHR
var fromUSDToKHR = ; const usd_amount = 2; // $ console; // 8000 riels
fromCustomAssetToUSD(custom_asset_amount, per_usd)
Convert the Custom Asset on Stellar to USD
var fromCustomAssetToUSD = ; const custom_asset_amount = 500;const per_usd = 40; // 40 == 1$ console; // 5$