Fixed the error that meant calculations failed.

Used the bignumber.js package to handle all our floating point needs