1.0.1 • Published 6 years ago

vue-tofixed2 v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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).