Last Updated: February 25, 2016
·
1.262K
· soulim

Represent number in different numeral systems

Use method Fixnum#to_s with radix (between 2 and 36) as parameter.

Examples:

1234567890.to_s(2)  #=> "1001001100101100000001011010010"
1234567890.to_s(8)  #=> "11145401322"
1234567890.to_s(16) #=> "499602d2"
1234567890.to_s(36) #=> "kf12oi"

Documentation