📅  最后修改于: 2022-03-11 15:01:21.895000             🧑  作者: Mango
/* https://www.npmjs.com/package/format-money-js */
const { FormatMoney } = require('format-money-js');
const fm = new FormatMoney({
decimals: 2
});
console.log(fm.from(12345.67, { symbol: '$' })); // return string: $12,345.67
console.log(fm.un('€12,345;67')); // return number: 12345.67