hello How can I change a vector's float value from ("1.085714e-01") format to a simpler format (like 0.1xxx). regards -- Ahmet Temiz Jeo. M?h. Afet ??leri Gen. Md.l??? Deprem Ar. D. Ahmet Temiz Geo. Eng. General Dir. of Disaster Affairs -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Henrique Dallazuanna
2008-Apr-24 11:09 UTC
[R] changing format of a float value to another
Try this: x <- "1.085714e-01" format(as.numeric(x), scientific = F) On Thu, Apr 24, 2008 at 7:28 AM, orkun <temiz@deprem.gov.tr> wrote:> hello > > How can I change a vector's float value from ("1.085714e-01") format to > a simpler format (like 0.1xxx). > > regards > > > -- > Ahmet Temiz > Jeo. Müh. > Afet Ýþleri Gen. Md.lüðü > Deprem Ar. D. > > Ahmet Temiz > Geo. Eng. > General Dir. of > Disaster Affairs > > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ______________________________________________ > R-help@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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
?sprintf> x <- "1.085714e-01" > sprintf("%.4f", as.numeric(x))[1] "0.1086">On Thu, Apr 24, 2008 at 6:28 AM, orkun <temiz at deprem.gov.tr> wrote:> hello > > How can I change a vector's float value from ("1.085714e-01") format to > a simpler format (like 0.1xxx). > > regards > > > -- > Ahmet Temiz > Jeo. M?h. > Afet ??leri Gen. Md.l??? > Deprem Ar. D. > > Ahmet Temiz > Geo. Eng. > General Dir. of > Disaster Affairs > > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ______________________________________________ > 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?