Using the floor smart value in an math expression - need proper syntax

Lopes_ Bonnie
Contributor
February 20, 2025

I have this math equation and it is working great, except that I am getting back a 2 decimal place and I only want the whole number

{{#=} {{varDoneCount.asNumber}}/{{varTotalCountSmart.asNumber}}* 100 {{/}}

I am not sure where and how to add the floor option as the documentation I read have it as a .Floor and that does not appear to work

I have been referencing:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

but there is no example when you have the * 100 result that you want to eliminate the decimals

Would I need to do another calc where I take the field value returned from this, then apply the .floor to that?

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2025

Hi @Lopes_ Bonnie 

There are two formats for many of the math functions: inline and long-format.

The inline ones can produce unexpected results because the chaining usually preserves the first value's typing, leading to integer division, etc.

For your scenario, I recommend using the long-format of FLOOR(), and as a side benefit the conversion of the variables to numbers is automagic:

{{#=}} FLOOR( {{varDoneCount}} / {{varTotalCountSmart}} * 100 ) {{/}}

 

If that does not help, please post images of your complete rule, the action where that expression is used, and the audit log details for more context.

Kind regards,
Bill

Lopes_ Bonnie
Contributor
February 21, 2025

Seems to be working

Lopes_ Bonnie
Contributor
February 21, 2025

 the varEpicCompletion create

varEpicCompletion.PNG

Lopes_ Bonnie
Contributor
February 21, 2025

it seems to be working, I will keep an eye on it.

THANK YOU

Bonnie

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events