replaced getCommas with a better function and also moved it to the Formatter class so it can be reused with other formatters