-
Notifications
You must be signed in to change notification settings - Fork 322
Open
Description
People are complaining about unexpected results when converting a string (usually prefixed with 0) to a number type.
The underlying strconv functions are called with 0 base which means it's trying to guess the base from the string.
There is a potential fix in #249, but we should probably document this better (and maybe add some tests/examples too).
Issues:
- Casting a string to int with a 0 in prefix does not work as expected #74
- bug of toInt toInt32 toInt64 #96
- toInt/toInt64 is wrong #112
- the function ToInt sometimes has some mistakes #133
- cast.ToInt("08") returned 0 #147
- cast.ToInt64E("16025123132364928") return 0 #162
- Unexpected results with padded strings #182
- cast toint32 but return zero #202
- cast.ToInt("08") return 0 and so on #214
- ToInt have bad case #216
- why cast.ToInt("08") return 0 then cast.ToInt("07") return 7 ? #220
- cast.ToUint32("0134444") = 47396 #232
- fix:string to uint64 error #228
- toIntBase10 enforces base 10 conversion #91
- add func
Atoito convert string base 10 #152 - the code「cast.ToInt("08") 」 has unexpected value result #290
- fix:string to uint64 error #228
Metadata
Metadata
Assignees
Labels
No labels