I have this expression, that sets a Jira field:
{{#=}} {{issue.customfield_10254|0}} * {{issue.customfield_10255|0}} {{/}}
Both customefields are of type number.
What I would like to do, is to format the result of the calculation, so that it looks like this:
€ 123.234,67
or at least:
123.234,67
I am aware of this page: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/#Format-numerical-values
I think I should be using something like this as a format:
€###.###,##
What I don't know is, how to add this notation
{{issue.xxxx.format("€###.###,##")}}
to the calculation
{{#=}} {{issue.customfield_10254|0}} * {{issue.customfield_10255|0}} {{/}}
Any thoughts on that?
Thank you
@Bernd Anderer
Hi,
You need to create both fields as variables before it goes into the final calculation. I did this for both my Inherent and Residual Risks.
Michelle
Hi Michelle,
Thank you for your answer.
if I understand you correctly, I would format both fields before they go into the calculation, correct?
One issue that I want to solve, is the number of digits after the comma. I only wanna have 2 digits.
A better example would be:
{{#=}} {{issue.customfield_10254|0}} / {{issue.customfield_10255|0}} {{/}}
In this case, I need to apply the formatting to the result in order to get the 2 digit.
e.g. 10,00 / 3,00 = 3,34
How would your solution achieve this goal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bernd,
That is correct - I borrowed heavily from one I found within the community answers.
I'm fortunate that mine are whole numbers only. You may have to go into the "Additional Fields" section and add some JSON coding or use Scriptrunner to achieve this level to get the decimals you want to be included.
This is as far as I know and I'm sorry I can't be of any further help on this,
Kind regards,
Michelle
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am surprised on how terrible Jira is in terms of number formatting.
This should be implemented on the customfield level.
In addition - once I formatted the values, they become a string. Even more pain.
Anyway - thank you for your feedback :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.