I want to convert Int to ternary base Like this:
42 -> 1120
What is the best way to do it in Scala?
You can use java.lang.Integer.toString(n, radix):
java.lang.Integer.toString(n, radix)
Integer.toString(42, 3)