Format a number with grouped thousands