...
Multiplicera med 100, avrunda till närmaste heltal och dividera med 100. Exempel:
Kodblock |
---|
when questions: Questions() then if (questions.get("vikt") != null && questions.get("langd") != null) { double vikt = questions.get("vikt"); double langd = questions.get("längd") / 100; double bmi = vikt / (langd * langd); outcome.set(Math.round(bmi * 100) / 100.0); } end |
...