Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast.ToInt64E("16025123132364928") return 0 #162

Open
longhuzhang opened this issue Dec 13, 2022 · 1 comment
Open

cast.ToInt64E("16025123132364928") return 0 #162

longhuzhang opened this issue Dec 13, 2022 · 1 comment

Comments

@longhuzhang
Copy link

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
}

@gia993
Copy link

gia993 commented Jan 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants