댓글 검색 목록

[Nodejs] 통화 변환

페이지 정보

작성자 운영자 작성일 20-03-02 14:53 조회 940 댓글 0

경량 통화 변환 라이브러리, money.js의 후속 버전


https://github.com/xxczaki/cashify 


const {Cashify} = require('cashify');
const currency = require('currency.js');

const rates = {
	GBP: 0.92,
	EUR: 1.00,
	USD: 1.12
};

const cashify = new Cashify({base: 'EUR', rates});

const converted = cashify.convert(8635619, {from: 'EUR', to: 'GBP'}); // => 7944769.48

// Format the conversion result
currency(converted, {symbol: '', formatWithSymbol: true}).format(); // => €7,944,769.48






댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.