[R] 'format' problem

Timur Elzhov Timur.Elzhov at jinr.ru
Fri Aug 1 15:58:01 CEST 2003


Dear R experts,

  format(12345678, digits = 2)

gives
  [1] "1.2e+07"

while
  format(1234567, digits = 2)

gives
  [1] "1234567"

but I'd like the last number to be represented as "1.2e+06" string too.

Where am I wrong?

Thanks,
Timur.




More information about the R-help mailing list