scala convert int to string code example Example: int to string scala val x = 42 x.toString // gives "42"