cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-yuazh-msft
Community Support
Community Support

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
ScottShearer
Super User
Super User

@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
v-yuazh-msft
Community Support
Community Support

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

Anonymous
Not applicable

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?
 
 

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

 

Anonymous
Not applicable

Hi Alice,

 

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

 

Thanks,

 

Alex

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (478)