I have a dataframe in R that contains a column called AverageSalary with just numbers that vary in length from 1-4 integers. I want to add 3 0's to the end of the number regardless of length and add a comma for every 3 integers.
I have tried a concatenation and sprintf
(gives me leading zeros). Does anybody have any ideas?
Average Salary Desired Format
3 3,000
144 144,000
5678 5,678,000