As Brich Thompson notes in the comments on “Convert between number bases easily”, you can also convert a number string in any base to a decimal number with the String#to_i method:
"21".to_i #=> 21 "21".to_i(8) #=> 17 "21".to_i(16) #=> 33
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.