From: Joel VanderWerf Date: 2005-11-03T16:51:36+09:00 Subject: Re: Newbie: How to format a number to always show two decimals? Alan Chen wrote: > That reminds me, what are the options for nicely text formatted table > output? I usually use something like: > [a.zolum, b.feb, c.gorza].inject("") { |row,col| row.concat "%7s" % col > } > > Are there better alternatives? > > - alan > irb(main):001:0> a=[1,2,3,4] => [1, 2, 3, 4] irb(main):002:0> ("%7s " * a.size) % a => " 1 2 3 4 " -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407