0

Strange thing happens with .toNumber function. It works well for account balance, but not for rate / endTime. I can't understand why, because balance is BigNumber and rate property is BigNumber (you can see screenshot). Has anyone similar issue and how it needs to be solved? I use Truffle 4 + VS Code.

enter image description here

3

Account balance returns BigNumber.

calls actually return a Promise.

If you do something like this, you should get the result in the console:

ico.rate.call().then(result => result.toNumber())
  • :) Thanks! I tried with this, but have made typo ico.rate.call().then(result = result.toNumber()). = instead of => :) What a relief... – Vanja Dev Feb 9 '18 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.