cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Integer/ Decimal numbers for subtractions and additions

Hi all, 

 

I am using a formula to calculate working days leave between two dates. However the formula doesn't appear to work well with flow.

 

 

Say it calculates I have taken off 8.5 days, and I want to use this number in the flow to subtract it from another list. Flow returns the error message that I can only use integers with the sub function. 

 

It seems pretty silly that I wouldn't be able to subtract decimal numbers, is this really the case?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Integer/ Decimal numbers for subtractions and additions

Hi @Anonymous,

 

Would you please share a screenshot of the configuration of your flow?

Would you please share the screenshot of the run history when the flow run failed?

Would you please share more details about the error message?

 

As @ScottShearer said, the sub function would work with decimal numbers.

 

I afraid that your flow is failed because you set the decimal numbers 8.5 in a number type column in sharepoint list.

Please make sure you have set the number type column of Number of decimal places.

Capture.PNG

 

Please share more details so we would try to provide a proper workaround for you.

 

Best regards,

Alice

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Integer/ Decimal numbers for subtractions and additions

@Anonymous:

 

You can use decimal numbers in a sub() expression.  Can you please post a screen shot of your Flow - that will make it much easier to assist.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Community Support
Community Support

Re: Integer/ Decimal numbers for subtractions and additions

Hi @Anonymous,

 

Would you please share a screenshot of the configuration of your flow?

Would you please share the screenshot of the run history when the flow run failed?

Would you please share more details about the error message?

 

As @ScottShearer said, the sub function would work with decimal numbers.

 

I afraid that your flow is failed because you set the decimal numbers 8.5 in a number type column in sharepoint list.

Please make sure you have set the number type column of Number of decimal places.

Capture.PNG

 

Please share more details so we would try to provide a proper workaround for you.

 

Best regards,

Alice

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Integer/ Decimal numbers for subtractions and additions

Hi Alice, 

 

The issue is that I need to subtract a decimal number or an integer, it really could be either. So obviously I can't input float and int.

Also if I input nothing before the formula: 

sub(items('Apply_to_each')?['eznj'],triggerBody()?['Working_x0020_Days_x0020_Leave'])
 
It tells me that the value is of type 'string'.
 
How can I get it to accept floats and integers?
 
 
Highlighted
Community Support
Community Support

Re: Integer/ Decimal numbers for subtractions and additions

Hi @Anonymous,

 

What is the type of eznj column and the Working Days Leave column in your list?

Please share the screenshot of the flow and the run history.

Also please share more details about the error message so we would tryto provide a proper workaround for you.

 

Best regards,

Alice

 

Highlighted
Anonymous
Not applicable

Re: Integer/ Decimal numbers for subtractions and additions

Hi Alice,

 

It works now, I have used the float function and set all numbers to have decimal places.

 

Thanks,

 

Alex

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (9,703)