package main import ( "fmt" "strconv" ) func fanzhuang32(number int) string { fuhao := "" if number < 0 { number = 0 - number fuhao = "-" } str1 := strconv.Itoa(number) j := len(str1) str := "" for i := j; i > 0; i-- { str += str1[i-1 : i] } return fuhao + str } func main() { re := fanzhuang32(-123456) fmt.Println(re) }