vue-tofixed2

1.0.1 • Public • Published

vue-tofixed2

由于js中进行小数计算会有精度问题,此方法用于金额计算(保留小数点后两位小数,并进行四舍五入)

Build Setup

# 安装
npm install vue-tofixed2

# import Rounding from 'Rounding'
在Main.js中引入

# Vue.use(Rounding)
全局注册Rounding

# this.operations(number1,number2,'运算符号')
组件中使用方法

例子 :计算 0.1 + 0.2
this.operations(0.1,0.2,'+')

(如果你有更好的建议和需求请联系我)


如果你有更好的创意和想法,欢迎各路大神来一起修改源码 [项目地址](http://vuejs.github.io/vue-loader).

Package Sidebar

Install

npm i vue-tofixed2

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

20.5 kB

Total Files

11

Last publish

Collaborators

  • show7