r studio format numbers code example Example: how to format a number in r format(round(as.numeric(1000.64), 1), nsmall=1, big.mark=",") # 1,000.6