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

How to receive decimal number result after dividing

hi all,

 

probably silly question, but can someone please guide me how can I receive a result in decimal number after dividing two numbers? I am always getting result in whole number. Formula looks like this:

 

div(int(variables('Recharge')),43300)
 
Thank you for any advice
Lukas
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: How to receive decimal number result after dividing

@lamacz:

 

How are you using the result?  Is it going into a variable?  If so, what is the data type of the variable.

 

Here is an example that shows getting a decimal output:

 

Int1.jpgInt2.jpgInt3.jpg

 

Scott

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

Scott

View solution in original post

Community Support Team
Community Support Team

Re: How to receive decimal number result after dividing

Hi @lamacz,

 

Have your problem be solved refer to @ScottShearer 's solution?

 

As @ScottShearer 's solution, you could convert the int value to float value, then you could get the float result after div.

 

The screensho of the flow as below:

Capture.PNG

 

The expression in the Compose as below:

div(variables('Recharge'),float(43300))

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: How to receive decimal number result after dividing

@lamacz:

 

How are you using the result?  Is it going into a variable?  If so, what is the data type of the variable.

 

Here is an example that shows getting a decimal output:

 

Int1.jpgInt2.jpgInt3.jpg

 

Scott

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

Scott

View solution in original post

Community Support Team
Community Support Team

Re: How to receive decimal number result after dividing

Hi @lamacz,

 

Have your problem be solved refer to @ScottShearer 's solution?

 

As @ScottShearer 's solution, you could convert the int value to float value, then you could get the float result after div.

 

The screensho of the flow as below:

Capture.PNG

 

The expression in the Compose as below:

div(variables('Recharge'),float(43300))

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

View solution in original post

Highlighted
lamacz
Level: Powered On

Re: How to receive decimal number result after dividing

hi both,

 

it was a truly silly qustion, yours solutions are working. I was incorrectly using integer type of variable to store results. 

 

Many thanks

Lukas

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 (Last 30 Days)
Users online (4,501)