On Apr 16, 4:47 pm, Jack Bauer <[email protected]>
wrote:
> I'm using a charting library that takes color values in hex, so white
> would be 0xffffff. This is a number, not a string, so doing something
> like "0x" + my_color_variable wouldn't work.
>
> If I have a variable from user input that is "FFFFFF", how can I convert
> it to the hex number 0xffffff?
the to_i method on string takes an optional argument (the base to
use).
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
-~----------~----~----~----~------~----~------~--~---