From: Alan Chen Date: 2005-11-03T09:57:09+09:00 Subject: Re: Newbie: How to format a number to always show two decimals? mental@rydia.net wrote: > Now, not being a former C programmer, you may not be so strongly > tempted to write: > > sprintf("%s%s%s", a.zolum, b.fep, c.gorza) > > when you could have simply written: > > "#{a.zolum}#{b.fep}#{c.gorza}" > > ..but if you ever are, please be aware that it's worth TWO kittens. 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