Cleaned up repeated code into setNum()
Added unit testing and fixed double decimal entry