Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #308 Integer to string in base b

Create the string representation s of the integer value n in base b.

18 in base 3 -> "200"
26 in base 5 -> "101"
121 in base 12 -> "a1"

import "strconv"
s := strconv.FormatInt(int64(n), b)

New implementation...
< >
lesmana