Improve representation of floats and integers, closes #1021