nebulasio / wiki

This repository is out of date, please check the new wiki:
http://wiki.nebulas.io/en/latest/
GNU General Public License v3.0
421 stars 154 forks source link

BigNumber不支持乘法运算multipliedBy? #205

Closed windpls closed 6 years ago

windpls commented 6 years ago

在合约里写了下述代码:

getRandom: function () {
        let count = new BigNumber("100");
        return count.multipliedBy(Math.random()).toFixed(0, 1).toString();
    }

但是报告:

{"result":"TypeError: count.multipliedBy is not a function","execute_err":"Call: TypeError: count.multipliedBy is not a function","estimate_gas":"20185"}
yupnano commented 6 years ago

你好,BigNumber中的乘法运算是 multimes (两者是等价的).