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

Round a Float

I need to round the value of a number that the flow will get from a file property.

What I want is to get this float x.yz and tranform it into x.00 (or an integer).

 

I have tried to use Int() but it seems it doesn't work.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Round a Float

Hi @MLM 

 

Please see the screenshot below:

int.PNG

Expression:

int(first(split(string(variables('ee')),'.')))

This converts the float to string and extracts the part before the decimal and then converts that to int. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Round a Float

Hi @MLM 

 

Please see the screenshot below:

int.PNG

Expression:

int(first(split(string(variables('ee')),'.')))

This converts the float to string and extracts the part before the decimal and then converts that to int. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

MLM
Level: Powered On

Re: Round a Float

This works.

Great Thank you!


@yashag2255 wrote:

Hi @MLM 

 

Please see the screenshot below:

int.PNG

Expression:

int(first(split(string(variables('ee')),'.')))

This converts the float to string and extracts the part before the decimal and then converts that to int. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!


 

Highlighted
Mscol
Level: Powered On

Re: Round a Float

This is a ridiculous workaround. Why doesn't MS Flow just have Round functions built-in? I have to instantiate TWO variables and have a five nested function calls? Absolutely absurd.

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users online (4,643)