cast icon indicating copy to clipboard operation
cast copied to clipboard

cast.ToInt64E("16025123132364928") return 0

Open longhuzhang opened this issue 2 years ago • 1 comments

parser string to int64 should use strconv.ParseInt(trimZeroDecimal(s), 10, 64) not the follow; v, err := strconv.ParseInt(trimZeroDecimal(s), 0, 0) if err == nil { return v, nil }

longhuzhang avatar Dec 13 '22 10:12 longhuzhang

parsing string ”08“ is the same problem return 0 s := "08" fmt.Println(strconv.Atoi(s)) // 8, nil fmt.Println(cast.ToInt(s)) //0

gia993 avatar Jan 10 '23 14:01 gia993