1

I want to do something individually with the BigNumbers that are returned here, but I am having trouble assigning them to variables.

truffle(develop)> reg.getProviderCurve(addr,spec) [ BigNumber { s: 1, e: 0, c: [ 1 ] }, BigNumber { s: 1, e: 0, c: [ 1 ] }, BigNumber { s: 1, e: 0, c: [ 2 ] } ] truffle(develop)> [n,m,p] = reg.getProviderCurve(addr,spec) TypeError: reg.getProviderCurve is not a function 

1 Answer 1

1

Depending on what you are trying to do, the default truffle syntax has bluebird included, and there you can replace

.then(...) with

.spread(function(bigNumber1, bigNumber2){ someVar = bigNumber1.toString(); someOtherVar = bigNumber2.toNumber(); }) 

if a contract has multiple return values. If you are just playing around with BigNumber objects, it might be that you need to instantiate n,m and p as BigNumber objects first.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.