Hello. In my opinion the function signif(1.4,digits=3) should give 1.40 but actually gives 1.4. Is there a magic way to add the trailing digits back (and converting to chracter at the same time ?) Regards, Paul.
Henrique Dallazuanna
2010-May-20 20:03 UTC
[R] Trailing zero's missing from signif function ?
Try this: sprintf('%.2f', 1.4) On Thu, May 20, 2010 at 4:58 PM, Paul <paul@paulhurley.co.uk> wrote:> Hello. > > In my opinion the function > > signif(1.4,digits=3) > > should give 1.40 > > but actually gives 1.4. Is there a magic way to add the trailing digits > back (and converting to chracter at the same time ?) > > Regards, > > Paul. > > ______________________________________________ > 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]]