go 进制转换

	var v int64 = 425217101 //默认10进制
	s2 := strconv.FormatInt(v, 2) //10 yo 16
	fmt.Printf("%v\n", s2)

	s8 := strconv.FormatInt(v, 8)
	fmt.Printf("%v\n", s8)

	s10 := strconv.FormatInt(v, 10)
	fmt.Printf("%v\n", s10)

	s16 := strconv.FormatInt(v, 16) //10 yo 16
	fmt.Printf("%v\n", s16)

	var sv = "19584c4d"; // 16 to 10
	fmt.Println(strconv.ParseInt(sv, 16, 32))

猜你喜欢

转载自my.oschina.net/u/1766862/blog/1820080