[R] Displaying trailing zeroes

Lucke, Joseph F Joseph.F.Lucke at uth.tmc.edu
Thu Jan 24 22:36:38 CET 2008

round(12.01,1) will give the answer 12, not 12.0 or even 12.  To make a
table look nice, I need to display the trailing zero so that just as
round(12.05,1) yields 12.1, round(12.01) yields 12.0. I cannot find an
answer in print() or format() or options().  Any suggestions would be
Joseph F. Lucke, PhD
Center for Clinical Research and Evidence-based Medicine
University of Texas Medical School at Houston
Email: Joseph.F.Lucke at uth.tmc.edu

More information about the R-help mailing list