Hello. I have a form where employees fill out a microsoft form providing information about gifts they have giving.
This includes the value of the gift. In the form I have said to do whole numbers to avoid issues with decimals but some people still put the value of their gift as a decimal - eg $164.95.
When this goes through the flow (which sends an email to their manager seeking approval for this gift) it can't convert this value to an integer like the whole number responses.
This is the flow composing the value from the form and then converting it to an integer to be used later
This is the result if the value from the form has a decimal
Is there a fix that allows me to maybe just tweak the 'Compose Int value' expression to allow decimals to go through just as easily as whole numbers?
Thank you
Solved! Go to Solution.
Hello @Power_Flow_Your ,
I agree with @GeorgiosG , you should consider to round the decimal number:
Just for your reference, I've created the Float "varIntDecimal" variable, then added a "Compose" action putting the following expression:
if(greaterOrEquals(Mod(variables('varIntDecimal'),1),0.5),add(int(first(split(string(variables('varIntDecimal')),'.'))),1),first(split(string(variables('varIntDecimal')),'.')))
So, in my case the output is "12":
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco
HI @Power_Flow_Your ,
you can try splitting your input with:
Hello @Power_Flow_Your ,
I agree with @GeorgiosG , you should consider to round the decimal number:
Just for your reference, I've created the Float "varIntDecimal" variable, then added a "Compose" action putting the following expression:
if(greaterOrEquals(Mod(variables('varIntDecimal'),1),0.5),add(int(first(split(string(variables('varIntDecimal')),'.'))),1),first(split(string(variables('varIntDecimal')),'.')))
So, in my case the output is "12":
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco
you can use also the following expression, it's much easier:
formatNumber(variables('varIntDecimal'),'#0')
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco