Hi. I imagine the answer to this is very simple, but I'm so sort of java developer and I'm stuck. I have 4 single select fields where each option in the pick list is a number. They are whole numbers (ex: 1, 2, 3, 5, 8, 13 ...
I need to add 3 of them and then divide the result by the fourth field. My problem is that I want the result to show the decimal value to one digit but it only returns whole numbers.
For ex: (8 + 5 + 3) / 5 = 3.2 but my calc number field shows 3. When I tell it to format the result to one decimal it gives me 3.0 instead of 3.2. Here's my formula:
@Formula:
if (issue.get("customfield_10899") == null) return null;
if (issue.get("customfield_10900") == null) return null;
if (issue.get("customfield_10901") == null) return null;
if (issue.get("customfield_10902") == null) return null;
((issue.get("customfield_10900") != null ? Integer.parseInt(issue.get("customfield_10900").toString()) : 0) +
(issue.get("customfield_10901") != null ? Integer.parseInt(issue.get("customfield_10901").toString()) : 0) +
(issue.get("customfield_10902") != null ? Integer.parseInt(issue.get("customfield_10902").toString()) : 0)) /
(issue.get("customfield_10899") != null ? Integer.parseInt(issue.get("customfield_10899").toString()) : 0)
-->
@Format:
numberTool.format("0.0", value)
-->
Any help is greatly appreciated!