Ruby/Number/hexadecimal numbers
Материал из Wiki.crossplatform.ru
Версия от 17:59, 13 сентября 2010; ViGOur (Обсуждение | вклад)
Convert string to hex
"405".hex # => 1029
Convert string to integer (hex)
"405".to_i(16) # => 1029 "fed".hex # => 4077 "fed".to_i(16) # => 4077
Hex number with 0x
puts 0x100 # => 256