jy-amount-format
v1.0.2
Published
金额格式化
Downloads
3
Readme
安装
npm i jy-amount-format --save
引入方式
import { formatAmount } from 'jy-amount-format'
功能说明
金额格式化
使用示例
import { formatAmount } from 'jy-amount-format'
console.log(formatAmount(1)) // 1.00
console.log(formatAmount(1.2, 2)) // 1.20
console.log(formatAmount(1000, 2)) // 1,000.00
console.log(formatAmount(10000, 3)) // 10,000.000
console.log(formatAmount(8888.88, 13)) // 8,888.8800000000000
console.log(formatAmount(13513518.0000133, 10)) // 13,513,518.0000133000
console.log(formatAmount(-13513518.0000133, 10)) // 13,513,518.0000133000
console.log(formatAmount(-8888.88, 13)) // 8,888.8800000000000