[R] changing format of a float value to another

jim holtman jholtman at gmail.com
Thu Apr 24 14:21:26 CEST 2008


?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?


More information about the R-help mailing list