Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

How to subtract a number with 1 decimal place

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I'm trying to subtract an MS Form submission value from a SharePoint list item value. This works well using the following expression in a compose operation with a whole number:

 

sub(int(outputs('Get_Item')?['body/RemainingDays']),int(outputs('Get_response_details')?['body/rbc6d3eaefe164d4daafd160f4304ac64']))

 

However, if my 'Get_response_details' value is 0.5 the flow fails. This is a valid scenario as I am calculating days and this would be a half-day.

 

RecTechUK_0-1653562688468.png

How can I change this to allow it to accept 1 decimal place?

 

Thanks in advance for any advice.

  • RTW Profile Picture
    RTW 180 on at
    Re: How to subtract a number with 1 decimal place

    When you use INT() it converts the number to an integer. A whole number. For decimals you'd have to use FLOAT() instead. Change your formula to this and it should work.

    sub(float(outputs('Get_Item')?['body/RemainingDays']),float(outputs('Get_response_details')?['body/rbc6d3eaefe164d4daafd160f4304ac64'])

  • MayankP Profile Picture
    MayankP 462 on at
    Re: How to subtract a number with 1 decimal place

    Hi @Anonymous 

     

    how about create variable of type float and store response of this expression inside that variable first before using it ...

     

    hope this helps..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard