题解 | #乘法#
乘法
http://www.nowcoder.com/practice/6429776e4630435cbc3eeb36bdf41f83
function multiply(a, b) {
function getl(num) {
const l = num.toString().indexOf('.')
return l == -1 ? 0 : num.toString().length - l - 1
}
return (a*b).toFixed(getl(a) + getl(b))
}