Skip to content

Newbie: Formatting numbers with commas

2 messages · Matthew Pettis, Henrik Bengtsson

#
Hi,

Search through the R archives, and couldn't find my answer... how do
you format numbers with commas (standard American, one every three
digits)?

Thanks,
Matt
#
x <- c(123023,143494035);
[1] "    123,023" "143,494,035"
[1] "123,023"     "143,494,035"

See also ?prettyNum (and formatC).

/Henrik

On Mon, Sep 22, 2008 at 9:23 PM, Matthew Pettis
<matthew.pettis at gmail.com> wrote: