Željko Filipin's Blog on Software and Testing

Test like you do not need the money.

Convert an Integer from Base 10 to Base 16

without comments

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”

Written by Željko Filipin

April 13th, 2007 at 4:44 pm

Posted in Ruby

Leave a Reply