Hex to Decimal
Complete the function which converts hex number (given as a string) to a decimal number.
function hexToDec(hexString: string):number{
return parseInt(hexString, 16);
}
console.log(hexToDec("FF"));
package main
import (
"fmt"
"strconv"
)
func hexToDec(hexString string) int64 {
decimal, _ := strconv.ParseInt(hexString, 16, 32)
return decimal
}
func main() {
fmt.Println(hexToDec("FF"))
}
def hex_to_dec(hexString):
return int(hexString, 16)
print(hex_to_dec("FF"))
function hexToDec($hexString) {
return hexdec($hexString);
}
echo hexToDec("FF");
Go to Kata
Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.
Let's see