Simple functions for formatting javascript numbers