# Issues with math in truffle tests

**URL:** <https://forum.openzeppelin.com/t/issues-with-math-in-truffle-tests/25914>\
**Category:** Smart Contracts\
**Created:** [March 9, 2022, 1:09pm UTC](https://forum.openzeppelin.com/t/issues-with-math-in-truffle-tests/25914 "2022-03-09T13:09:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alvaro\_Betancourt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/alvaro_betancourt/32/12122_2.png) [@Alvaro\_Betancourt](https://forum.openzeppelin.com/u/Alvaro_Betancourt)\
**Post date:** [March 9, 2022, 1:09pm UTC](https://forum.openzeppelin.com/t/issues-with-math-in-truffle-tests/25914/1 "2022-03-09T13:09:02Z")

</div>

Hello Everyone 👋

I am currently building a Dapp from a tutorial from an article online, I'll post the line for reference, at the point where I'm testing the smart contract with truffle.  
[https://itnext.io/building-a-decentralized-application-with-bep-20-contract-in-solidity-d2c066447aa6](https://itnext.io/building-a-decentralized-application-with-bep-20-contract-in-solidity-d2c066447aa6)

I still receive 2 failing tests indicating that the **AssertionError: The totalSupply should have been increased: expected '50000000000000000000100' to equal 4.999999999999999e+24 and another** , I am writing it as: \*_totalSupply.toString()100 + 100_ since writing in **.toNumber** won't return the value without big number.js which was another issue to work around

How would I be able to resolve this error? Thank you

 ![Screen Shot 2022-03-09 at 8.01.48 PM](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/1/1344c848f73c5bb396d434c3d8fc2b5c045d542d.jpeg)  
 ![Screen Shot 2022-03-09 at 8.02.06 PM](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/a/a71ad6c23d82c7f0f49cdd7fbbc08be0a1f13fc7.png)

 ![Screen Shot 2022-03-09 at 8.02.21 PM](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/f/fb5f0813480c39f5beaff7b1d644bb4dc12f632c.png)

---

<div class="post-metadata">

**Author:** ![victory015](https://avatars.discourse-cdn.com/v4/letter/v/a3d4f5/32.png) [@victory015](https://forum.openzeppelin.com/u/victory015)\
**Post date:** [March 9, 2022, 1:24pm UTC](https://forum.openzeppelin.com/t/issues-with-math-in-truffle-tests/25914/2 "2022-03-09T13:24:27Z")

</div>

In the minting test case, the after\_supply should be checked after minting, not before minting.

---

<div class="post-metadata">

**Author:** ![Alvaro\_Betancourt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/alvaro_betancourt/32/12122_2.png) [@Alvaro\_Betancourt](https://forum.openzeppelin.com/u/Alvaro_Betancourt)\
**Post date:** [March 9, 2022, 3:26pm UTC](https://forum.openzeppelin.com/t/issues-with-math-in-truffle-tests/25914/3 "2022-03-09T15:26:36Z")

</div>

But I look into my code that the after\_supply is being checked at the end. Could you please explain why you see after\_supply is being checked before minting? Thank you
