I want to format my data so that decimals are only shown for non-whole numbers. e.g. Count 1,000 2 578 7.1 67,253.52 22,000 3,211 ... I've tried playing with the commaw.d format, but that appends trailing zeros to every number depending on the value of d. Edit: A bit more context - my data is count/sum data grouped by a categorical variable, and while the vast majority of the rows are, by nature, whole numbers, some of the items can have decimal counts. However, because the decimal items are so sparse, I'd rather not include decimals for every number since it's largely unnecessary and distracting. Adjusted example numbers to use commas.
... View more