Change a variable using operators

3
I am trying to change a variable $discountedPrice of type float/currency as follows: $DiscountedPrice - ($DiscountedPrice*$PriceLineItem_iterator/Discount * 0.01) I am expecting the following result: 52- (52 * 10 * 0.01) = 46,80 The last part (* 0.01) is not processed so the result I am getting back is incorrect (-468) What is wrong here?
asked
6 answers
1

Theo, did you also tried:

$DiscountedPrice - ($DiscountedPrice*($PriceLine/Discount *0.01))

I thought the modeler calculates by the general math rules. So first * and : , then + - etc. Also the part between ( ) is handled first.

So in this example:

52- (52 * (10 * 0.01)) = 46,80

answered
1

Tried both: $DiscountedPrice - ( ( $DiscountedPrice$PriceLineItem_iterator/Discount ) * 0.01) and $DiscountedPrice - ( ( $DiscountedPrice$PriceLineItem_iterator/Discount ) :100)

but without any result....

answered
1

None of the solutions above are necessary. This calculation should work as it is. I have just tried it in a simple microflow and the outcome of my calculation is 46.8 just as you were expecting.

Can you give some more information about your flow. And have you tried debugging your microflow? Maybe you can post some of the microflow debug information here so we can help you find the problem.

answered
0

Perhaps you can try 0,01 instead of 0.01? Just a suggestion, I am not sure it's the right solution.

answered
0

A workaround might be using ": 100" instead of "* 0.01".

answered
-1

$DiscountedPrice - ( ( $DiscountedPrice*$PriceLineItem_iterator/Discount ) * 0.01)

How about trying it like this? I would think it's not multiplying them in the correct order as it is now.

answered