dear MC Community,
How can I output a text from a numeric value?
My smoke addiction calculation works. Depending on the addiction level which is a number, a text, i.e. an adjective should be output accordingly.
Example message in the app:
Your score:
On a scale of 1 (low addiction) and 10 (high addiction), your score is $addictionScore
The value of $addictionScore
is determined correctly here.
But now I want to display this value as text and make a statement from it:
Example message:
Based on your statements, a $smokingAddictionLevel
Addiction can be determined.
Instead of where the variable $smokingAddictionLevel
is located the expressions “low”, “medium”, “high” and “very high” should appear depending on the result of $addictionScore
.
My $smokingAddictionLevel
calculation does not return the text. What is wrong here?