Using the web3 javascript library from the user interface or from the a Truffle javascript unit testing, you can sometimes get an object that look somehow like:
{[String: '5'] s: 1, e: 0, c: [5]}
It means the result has the BigNumber type, web3.js converts every integer that comes from solidity into BigNumber because solidity integers have a bigger range than javascript integers. Use simple the toNumber() call to convert, like:
result.toNumber();