Logo

Programming-Idioms

  • C
  • Java
  • Go

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)
String s = Integer.toString(n, b);
let s = n.toString(b);

New implementation...
< >
lesmana