cast icon indicating copy to clipboard operation
cast copied to clipboard

add func `Atoi` to convert string base 10

Open superqtqt opened this issue 2 years ago • 2 comments

add func Atoi to convert string base 10, example : "0890" -> 890

#https://github.com/spf13/cast/issues/147

superqtqt avatar Aug 15 '22 03:08 superqtqt

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 15 '22 03:08 CLAassistant

This is a really bad idea. Since the beginning of the C language, there has been a convention of starting with "0" for octal numbers and "0x" for hexadecimal numbers. Why should we change this convention? If you want to remove the leading 0, do it before calling cast.

yveshield avatar Feb 09 '23 01:02 yveshield