I am making an educational mathematic game. The game must have a calculator and be able to be as accurate with calculations as possible.

With the var I have found that when using decimals, the results are rarely accurate. I have scripted a calculator but had to remove decimal functionality due to the .2 being seen as .199. So, if the player multiplies .2 and 1 the answer on the calculator screen is “.199”! There are many other examples of this with other decimals. The manual does say calculations are inaccurate, but I wasn’t expecting the above to be true.

So what I guess I’m looking for is some help. Is there a workaround that can add accuracy? I need to add, subtract, multiply, divide, and take the square root on both the calculator and other calculations throughout the game. I would like accuracy to two decimals if possible. The engine always calculates the same which is good, but if the player compares the answers to a calculator, they are generally incorrect. This is not acceptable for a game which teaches math.

Would a .dll be what I’m looking for?