cancel
Showing results forย
Did you mean:ย
Helper II

## Round up when Dividing numbers

Hello Teams, I'm using 'Div' function to divide a number by 30 and I want to round up the result. For example, 139/30 = 4.6666....The flow returns the result as 4 , but I want to get the Round Up result, which is 4.666 becomes 5 (whole integer). I tried "int(first(split(string(variables('ee')),'.')))" a solution from another post but it seems not work for me. How should I round up the result? Thanks
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III

Hello @emmahuynh

could you try this:

`if(Mod(float(30),139) > .49,div(float(30),139)+1,div(float(30,139))`

If you like my post please hit the Thumbs Up

Proud to be a Flownaut!

Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete

Super User II

Hey there.  You could also use the Format Number action, put your dynamic value (or div expression) in the Number field, and then for the Format, select "Add a custom item", and in the pop-up, just enter '#' (without the quotes) and click ok.

The output from that action should be a rounded, whole integer.

Either way, keep us posted.  Good luck!

-Ed

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

3 REPLIES 3
Super User III

Hello @emmahuynh

could you try this:

`if(Mod(float(30),139) > .49,div(float(30),139)+1,div(float(30,139))`

If you like my post please hit the Thumbs Up

Proud to be a Flownaut!

Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete

Super User II

Hey there.  You could also use the Format Number action, put your dynamic value (or div expression) in the Number field, and then for the Format, select "Add a custom item", and in the pop-up, just enter '#' (without the quotes) and click ok.

The output from that action should be a rounded, whole integer.

Either way, keep us posted.  Good luck!

-Ed

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Helper II

thanks so much. This solution works for me.

Announcements

Check out the new Process Advisor community forum board!

#### Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors
Users online (11,438)