Re: [R] Pretty printing numbers

2011-05-09 Thread Peter Ehlers
On 2011-05-08 16:41, Worik R wrote: Friends I am trying to format a number to a string so 2189.745 goes to 2,189.35 and 309283.929 goes to 309,283.93 I have tried to use formatC(X, big.mark=,,drop0trailing=FALSE, format=f) but it does not get the number of decimals correct. Specifying digits

[R] Pretty printing numbers

2011-05-08 Thread Worik R
Friends I am trying to format a number to a string so 2189.745 goes to 2,189.35 and 309283.929 goes to 309,283.93 I have tried to use formatC(X, big.mark=,,drop0trailing=FALSE, format=f) but it does not get the number of decimals correct. Specifying digits does not work as that is significant

Re: [R] Pretty printing numbers

2011-05-08 Thread Peter Langfelder
On Sun, May 8, 2011 at 4:41 PM, Worik R wor...@gmail.com wrote: Friends I am trying to format a number to a string so 2189.745 goes to 2,189.35 and 309283.929 goes to 309,283.93 I have tried to use formatC(X, big.mark=,,drop0trailing=FALSE, format=f) but it does not get the number of

Re: [R] Pretty printing numbers

2011-05-08 Thread Worik R
formatC(round(2189.745, 2), big.mark=,,format=f) [1] 2,189.7400 Unfortunately this does not work Worik On Mon, May 9, 2011 at 11:45 AM, Peter Langfelder peter.langfel...@gmail.com wrote: On Sun, May 8, 2011 at 4:41 PM, Worik R wor...@gmail.com wrote: Friends I am trying to format a

Re: [R] Pretty printing numbers

2011-05-08 Thread David Winsemius
On May 8, 2011, at 8:02 PM, Worik R wrote: formatC(round(2189.745, 2), big.mark=,,format=f) [1] 2,189.7400 Unfortunately this does not work Because you did not follow his example. -- David. Worik On Mon, May 9, 2011 at 11:45 AM, Peter Langfelder peter.langfel...@gmail.com wrote: On

Re: [R] Pretty printing numbers

2011-05-08 Thread Worik R
On Mon, May 9, 2011 at 12:06 PM, David Winsemius dwinsem...@comcast.netwrote: On May 8, 2011, at 8:02 PM, Worik R wrote: formatC(round(2189.745, 2), big.mark=,,format=f) [1] 2,189.7400 Unfortunately this does not work Because you did not follow his example. That is true. I did not

Re: [R] Pretty printing numbers

2011-05-08 Thread Henrique Dallazuanna
formatC(round(2189.745, 2), big.mark=,,format=f, drop0trailing = TRUE) On Sun, May 8, 2011 at 9:02 PM, Worik R wor...@gmail.com wrote: formatC(round(2189.745, 2), big.mark=,,format=f) [1] 2,189.7400 Unfortunately this does not work Worik On Mon, May 9, 2011 at 11:45 AM, Peter Langfelder