O'Reilly logo

Go Standard Library Cookbook by Radomir Sohlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The strconv package provides the functions ParseInt and FormatInt which are the, let's say, complementary functions. The function ParseInt is able to parse the integer number in any base representation. The function FormatInt, on the other hand, can format the integer into any given base. 

Finally, it is possible to parse the string representation of the integer to the built-in int64 type and subsequently, format the string of the parsed integer into the given base representation.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required