Skip to content
Prev 324613 / 398503 Next

Scale package change comma defaults?

John Kane <jrkrideau <at> inbox.com> writes:
Since the comma() function is just a wrapper for format():
function (x, ...) 
{
    format(x, ..., big.mark = ",", scientific = FALSE, trim = TRUE)
}

Why not just define your own function that does what you want?

myComma <- function (x, big.mark=",", ...) 
{
    format(x, ..., big.mark = big.mark, scientific = FALSE, trim = TRUE)
}

myComma(1000,".")
TRUE) :
Not quite sure what you mean here; see ?format for more details.

format(1200,big.mark=".",nsmall=2)

might be what you want, but if you're going to use "." for big.mark
then you might want:
    
options(OutDec=",")

[1] "1.200,00"