here is a inline example using when()
val testBoolean = true; val converted = when(testBoolean){true->1; false->0} println("This Boolean to Int = $converted") println("This Boolean to String ${ when(testBoolean){true->"ON"; false->"OFF"} }")