currency-transform
v0.1.1
Published
汇率转换,内部使用百度汇率转换 `api`
Downloads
1
Readme
currency-transform
汇率转换,内部使用百度汇率转换 api
Install
Node.js 4 or higher
$ npm install currency-transform --save
Usage
var transform = require('currency-transform')
transform({
apiKey: '', // add your baidu developer apiKey
from: 'JPY',
amount: 100
}).then(function(data) {
console.log(data)
})
API
transform(options)
options
参数定义
options.apiKey
API密钥options.from
待转化的币种,默认USD
options.to
转化后的币种,默认CNY
options.amount
转化金额,默认1
返回内容 data
{
fromCurrency: 'USD', //待转化币种的简称,这里为美元
toCurrency: 'CNY', //转化后的币种的简称,这里为人民币
date: '2016-06-23', //日期
time: '14:37:44', //时间
currency: '6.576500', //当前汇率
amount: 1, //转化的金额
convertedamount: 6.5765 //转化后的金额
}