On Apr 16, 5:20 pm, Jack Bauer <[email protected]>
wrote:
> Frederick Cheung wrote:
>
> Yes, but it doesn't convert it the way I need it to. What I mean is:
>
> "FFFFFF".to_i(base=16) # => 16777215
>
> I need it to be more like this:
>
> "FFFFFF".whatever_magic_method # => 0xFFFFFF
Those are exactly the same integer - the console just shows them to
you in base 10 by default. to_s takes a similar base argument if you
need to get a string out of it again.
Fred
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---