fixed invalid number to string conversion for edge cases
be more strict with numeric limits