Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Want to convert Minutes in Days in structure

Sanjivani Wayal
Contributor
March 20, 2023

I wanted to convert 1 Hr 45 minutes to days so i followed below steps

1) i converted 1 hr 45 min in minutes by using below :-

WITH _originalestimateM = (originalestimate/60)/1000 -- it is giving me 105 which is correct

2) Now when i try to convert minutes into days which is as per formula divide by 1440 

WITH _originalestimateD = (_originalestimateM /1440)

it gives me 0 where as i wanted to decimal value which comes around 0.0729167 days

 

Is there a way to do it or any other way i can do it?

1 answer

1 accepted

1 vote
Answer accepted
Oday Rafeh
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.
March 20, 2023

@Sanjivani Wayal 

It seems like the division is being performed as an integer division, which discards the decimal part of the result. To ensure the result is displayed as a decimal value, you can cast the numerator or the denominator to a floating-point number (float) or a decimal number.

Updated formula:

WITH _originalestimateM = (originalestimate/60)/1000
WITH _originalestimateD = (CAST(_originalestimateM AS float) / 1440)

Regards 

Oday

Sanjivani Wayal
Contributor
March 20, 2023

WITH _originalestimateD = (CAST(_originalestimateM AS float)/1440) :

 

is giving me error of Invalid Expression in cloud JIRA

Oday Rafeh
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.
March 20, 2023

Jira Cloud Might not support the CAST function, we can try the 'ROUND' function instead


WITH _originalestimateD = ROUND(_originalestimateM / 1440.0, 7)
Sanjivani Wayal
Contributor
March 20, 2023

Above still gives me 0

Oday Rafeh
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.
March 20, 2023

Okay, You can try to calculate the decimal value directly within the same expression:

 

WITH _originalestimateD = ((originalestimate / 60.0) / 1000) / 1440
Sanjivani Wayal
Contributor
March 20, 2023

Hey it worked i used Markdown format Thank you so much for help :)

Like # people like this
Oday Rafeh
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.
March 20, 2023

Nice to hear that, 

Have a nice day 

Suggest an answer

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

Atlassian Community Events