How to format strings in Scala?

Viewed 16215

I need to print a formatted string containing scala.Long. java.lang.String.format() is incompatible with scala.Long (compile time) and RichLong (java.util.IllegalFormatConversionException)

Compiler warns about deprecation of Integer on the following working code:

val number:Long = 3243
String.format("%d", new java.lang.Long(number))

Should I change fomatter, data type or something else?

3 Answers
Related