him-ich-currency-converter

1.0.0 • Public • Published

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 } = require('him-ich-currency-converter');
 
const usd_amount = 2; // $
const per_usd = 40; // 1$ == 40
 
console.log(fromUSDToCustomAsset(usd_amount, per_usd)); // 80

fromUSDToKHR(usd_amount, per_usd = 4000)

Convert the amount in USD to KHR

var { fromUSDToKHR } = require('him-ich-currency-converter');
 
const usd_amount = 2; // $
 
console.log(fromUSDToKHR(usd_amount)); // 8000 riels

fromCustomAssetToUSD(custom_asset_amount, per_usd)

Convert the Custom Asset on Stellar to USD

var { fromCustomAssetToUSD } = require('him-ich-currency-converter');
 
const custom_asset_amount = 500;
const per_usd = 40; // 40 == 1$
 
console.log(fromCustomAssetToUSD(custom_asset_amount, per_usd)); // 5$

Package Sidebar

Install

npm i him-ich-currency-converter

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.69 kB

Total Files

3

Last publish

Collaborators

  • him-ich