[R] Truncating (not rounding) scientific value in R

Daniel Malter
Tue, 08 Sep 2009 07:33:20 -0000

x=0.00000000000001345778543577
signif(x,3)


-------------------------
cuncta stricte discussurus
-------------------------

-----Urspr?ngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von Gundala Viswanath
Gesendet: Tuesday, September 08, 2009 2:13 AM
An: r-help at stat.math.ethz.ch
Betreff: [R] Truncating (not rounding) scientific value in R

How can I truncate the scientific value keeping two digits decimal.
For example from:

6.95428812397439e-35

into

6.95e-35

-E.W.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.