Hi, I have a calculation that is supposed to return the 'next' sales target (they are rewarded for each additional 10% they achieve over a base target)
The formula:
int(string(mul(items('Get_each_FD_to_update')['new_target'],add(div(add(outputs('multiplier'),1),10),1))))
With the inputs of 5000 and 27 for 'new_target' and 'multiplier' respectively I get a result of 15000 but it should be 19000
Working inside out it should be
27+1 = 28
28/10 = 2.8
2.8+1 = 3.8
5000 * 3.8 = 19000
convert to string
convert to int
even if I remove the int(string( part it still give the wrong answer. I have also tried wrapping it in numberFormat(formula, '0') instead. What is going on here?
Solved! Go to Solution.
Hi @Carrotor,
Since your using decimals can you try using float?
Try this expression instead:
mul(float(items('Get_each_FD_to_update')['new_target']), add(div(add(float(outputs('multiplier')), 1), 10),1))
Hi @Carrotor,
Since your using decimals can you try using float?
Try this expression instead:
mul(float(items('Get_each_FD_to_update')['new_target']), add(div(add(float(outputs('multiplier')), 1), 10),1))
Just as this came though I found the same(ish) solution through trial and error. It would appear that dividing two integers will always give an integer result which sounds like something I half remember from a computer science class I took 20 years ago. the final formula I ended up with was:
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.