Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Ruby 中,可以使用以下方法将十六进制字符串转换为十进制数String#hex:
String#hex
"1a2f".hex # => 6703
如何在水晶中做到这一点?
只需String#to_i以 16 为基数使用:
String#to_i
"1a2f".to_i(16) # => 6703