📜  货币格式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.895000             🧑  作者: Mango

代码示例1
/* 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