How to convert an integer to a string in base b with Scala

1 Answer

0 votes
val number = 255
val base = 16

val result = Integer.toString(number, base).toUpperCase

println(result) 



 
/*
run:
  
FF
  
*/

 



answered Aug 18, 2025 by avibootz
...