Filipin.eu

Željko Filipin's blog.
Home Blog Tags License

View on GitHub
13 April 2007

Convert an Integer from Base 10 to Base 16

by Željko Filipin

tags: code · ruby

Estimated reading time is 1 minute.

I needed to convert an integer from base 10 to base 16. I found the solution at ruby-talk.

Example: convert 15 from base 10 to base 16.

15.to_s(16)
#=> "f"

Feedback

Thank you for reading. If you want to stay in touch please use the feed or send me an email.