cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeterKuehlian
Level: Powered On

Reduce decimals to 1

Hi 

 

I am trying to get a solution of a calculation in my flow with only one decimal. 

 

Here is my flow:

I am picking up the file Size of my document and want to create exact the same value in another column. The purpose of this is, that I want to check if the content of my document has changed or not. 

 

So in this flow my file size is at 53.100000000917841. I want it to be 53.1.

 

Once this is done i just add KB to the string and i can compare it to my metadata-field Document Size. (Hopefully Smiley Wink )

 

Snag_1c2d43b.png

 

Thanks in advance

 

BR

Peter

 

2 REPLIES 2
Willemijn
Level 8

Re: Reduce decimals to 1

Hi!

 

You first need to convert the float to a string and then you could use substring in combination with indexOf for that: substring(string(variables('decimal Value')),0,add(2,indexOf(string(variables('decimal Value')),'.')))

result: 
image.png
PeterKuehlian
Level: Powered On

Re: Reduce decimals to 1

Hi 

 

That works great. 

 

Only one more thing I need to apply.

I have to round my decimal correctly. 

In the example in the picture, I want the full number to be 53.1

Snag_e0b08.png

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 292 members 3,155 guests
Please welcome our newest community members: