Dear Timur, sprintf may be what you want: sprintf("%.1e", 12345678) sprintf("%.1e", 1234567)
Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia [EMAIL PROTECTED] Quoting Timur Elzhov <[EMAIL PROTECTED]>: > 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. > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help