console.log(average(10,3))
// value 数值
// amount 分配数量
// point 小数点位数
function average(value,amount,point){
if(!point){
point = 2
}
let list = []
let first = (Math.floor((value/amount)*Math.pow(10,point))/Math.pow(10,point)).toFixed(point)
let last = (value - first*(amount - 1)).toFixed(point)
for(let i = 0;i<amount-1;i++){
list.push(first)
}
list.push(last)
return list
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。