[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Noob question: How to do number formatting?

Ben Johnson

8/21/2006 9:28:00 PM

I searched the documentation and everything and can't find a simple
method for number formatting. Any links?

thanks for your help.

--
Posted via http://www.ruby-....

3 Answers

Tim Hunter

8/21/2006 9:32:00 PM

0

Ben Johnson wrote:
> I searched the documentation and everything and can't find a simple
> method for number formatting. Any links?
>
> thanks for your help.
>
>
Use ri to look up printf, sprintf, and String#%

Chris Gehlker

8/21/2006 9:38:00 PM

0


On Aug 21, 2006, at 2:27 PM, Ben Johnson wrote:

> I searched the documentation and everything and can't find a simple
> method for number formatting. Any links?

Do you know how C formatting works? The Ruby printf methods work the
same way. The details are given with:
ri Kernel#sprintf




--
Conscience is thoroughly well-bred and soon leaves off talking to
those who do not wish to hear it.
-Samuel Butler, writer (1835-1902)




Thorsten Haude

8/21/2006 9:42:00 PM

0

Hi,

* Ben Johnson wrote (2006-08-22 06:27):
>I searched the documentation and everything and can't find a simple
>method for number formatting. Any links?

Something like this?

http://www.rubycentral.com/ref/ref_m_kernel.ht...


Thorsten Broken Social Scene: It's all gonna break
--
Endorsing products is the American way of expressing individuality.
- Calvin