Is There an Easy Way to Convert a Boolean to an Integer?
- by Russ Bradberry
I am new to scala and I am finding the need to convert a boolean value to an integer. I know i can use something like if (x) 0 else 1 but I would like to know if there is a preferred method, or something built into the framework (ie toInt())