num-computed

1.0.1 • Public • Published

加法:floatAdd(32.1321, 35435.524)

减法:floatSub(754532432.1321, 35435.524)

乘法:floatMultiply(32.1321, 35435.524)

除法:floatDivide(32.1321, 35435.524)

保留小数:truncateDecimals(num, decimalPlaces)

参数 名称 默认值 数值类型 非空
num 待处理数据 - String
decimalPlaces 截取小数位数 0 Number

金额格式化 formatMoney(amount, bool, decimalPlaces)

参数 名称 默认值 数据类型 可为非空
amount 待处理数据 - String
bool 是否保留千分位 true Boolean
decimalPlaces 格式化位数 2 Number

npm仓库地址:https://www.npmjs.com/package/num-computed

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i num-computed

      Weekly Downloads

      0

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      5.69 kB

      Total Files

      3

      Last publish

      Collaborators

      • **spark**