1、利用这两行代码获取数字的小数位数
let arrA = a.toString().split(".");
let lenA = arrA.length === 1 ? 0 : arrA[1].length
2、toFixed()指定结果的小数位数