Hexadecimal String to Integer

From SwiftAPI

Jump to: navigation, search

Contents

Perl

perldoc

$h = "12D687";
$n = hex($h);
# $n == 1234567

PHP

php.net

$h = "12D687";
$n = hexdec($h);
// $n == 1234567

Python

docs.python.org

h = "12D687"
n = int(h, 16)
# n == 1234567

Ruby

Ruby-Doc.org

h = "12D687"
n = h.hex
# n == 1234567
Personal tools