I'm writing a simple function to take two variables and return a single float, that I'm trying to print.
fun main() {
val fugacity = fo2(1200,1).NNO()
println(fugacity)
}
class fo2(val Tc: Int,val P: Int) {
fun NNO() {
val Tk = Tc+273.15
val fug = ((-24930.0/Tk)+9.36+(0.046*(P-1.0)/Tk))
return fug.toString()
}
}
the output is an error 'Type mismatch: inferred type is String but Unit was expected'
I understand that the UNIT type is a null output but I don't understand why this simple sum's output is null. Can anyone help?
Cheers
Ed