Float Question
- From: Armando Padilla <mando81@xxxxxxxxxxx>
- Date: Sat, 01 Dec 2007 07:26:06 GMT
This is probably the stupidest question ive ever had to ask on any board so im sorry lol. :-p
Yes i've googled and found a solution but i cant believe that the solution presented is correct or that the great minds behind ruby did not include something like this.
I want to get a float 2.3333 to display as 2.33 or 2.333 etc.
Now, i read the manual, Numerical, Float, Math sections but could not find a way to do this. Yes you can use string manipulation but that just defeats the purpose of having something like this built into the Float stack.
ex. someFloat = Float.new(2) ==> 2.12
someFloat = Float.new(5) => 2.12345
Any thoughts?
.
- Follow-Ups:
- Re: Float Question
- From: Chris Cummer
- Re: Float Question
- Prev by Date: Re: tag, tag_end in parser
- Next by Date: Re: Printing throught LPT1
- Previous by thread: NTLM authentication with httpclient
- Next by thread: Re: Float Question
- Index(es):
Relevant Pages
|