cancel
Showing results for
Did you mean:
Frequent Visitor

## 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)

Lukas
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III

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:

Scott

If you like my response, please give it a Thumbs Up.

Scott
Community Support

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:

The expression in the Compose as below:

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

The flow would run successfully as below:

Best regards,

Alice

3 REPLIES 3
Super User III

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:

Scott

If you like my response, please give it a Thumbs Up.

Scott
Community Support

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:

The expression in the Compose as below:

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

The flow would run successfully as below:

Best regards,

Alice

Frequent Visitor

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

Announcements

#### Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

#### Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

#### Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,150)